Class ReferenceTypeImpl
java.lang.Object
com.github.javaparser.resolution.types.ResolvedReferenceType
com.github.javaparser.resolution.model.typesystem.ReferenceTypeImpl
- All Implemented Interfaces:
ResolvedTypeParameterValueProvider
,ResolvedTypeParametrized
,ResolvedType
-
Field Summary
FieldsFields inherited from class com.github.javaparser.resolution.types.ResolvedReferenceType
JAVA_LANG_ENUM, JAVA_LANG_OBJECT, typeDeclaration, typeParametersMap
-
Constructor Summary
ConstructorsConstructorDescriptionReferenceTypeImpl
(ResolvedReferenceTypeDeclaration typeDeclaration) ReferenceTypeImpl
(ResolvedReferenceTypeDeclaration typeDeclaration, List<ResolvedType> typeArguments) -
Method Summary
Modifier and TypeMethodDescriptionprotected ResolvedReferenceType
create
(ResolvedReferenceTypeDeclaration typeDeclaration) protected ResolvedReferenceType
create
(ResolvedReferenceTypeDeclaration typeDeclaration, List<ResolvedType> typeParametersCorrected) deriveTypeParameters
(ResolvedTypeParametersMap typeParametersMap) Return all ancestors, that means all superclasses and interfaces.Return all ancestors, that means all superclasses and interfaces.Fields declared on this type.Methods declared on this type.Return direct ancestors, that means the superclasses and interfaces implemented directly.boolean
isAssignableBy
(ResolvedType other) This method checks if ThisType t = new OtherType() would compile.private boolean
boolean
mention
(List<ResolvedTypeParameterDeclaration> typeParameters) Does this type mention at all, directly or indirectly, the given type parameters?transformTypeParameters
(ResolvedTypeTransformer transformer) Execute a transformation on all the type parameters of this element.static ResolvedReferenceType
undeterminedParameters
(ResolvedReferenceTypeDeclaration typeDeclaration) Methods inherited from class com.github.javaparser.resolution.types.ResolvedReferenceType
asReferenceType, compareConsideringTypeParameters, create, describe, equals, erasure, getAllClassesAncestors, getAllFieldsVisibleToInheritors, getAllInterfacesAncestors, getAllMethods, getAllMethodsVisibleToInheritors, getFieldType, getGenericParameterByName, getId, getQualifiedName, getTypeDeclaration, getTypeParametersMap, hashCode, hasName, isCorrespondingBoxingType, isJavaLangEnum, isJavaLangObject, isRawType, isReferenceType, isUnboxable, isUnboxableTo, replaceTypeVariables, toDescriptor, toString, toUnboxedType, typeParametersMap, typeParametersValues, typeParamValue
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.github.javaparser.resolution.types.ResolvedType
arrayLevel, asArrayType, asConstraintType, asPrimitive, asTypeVariable, asUnionType, asWildcard, isArray, isConstraint, isInferenceVariable, isNull, isNumericType, isPrimitive, isReference, isTypeVariable, isUnionType, isVoid, isWildcard, replaceTypeVariables, solveGenericTypes
Methods inherited from interface com.github.javaparser.resolution.types.parametrization.ResolvedTypeParameterValueProvider
useThisTypeParametersOnTheGivenType
-
Field Details
-
ASSIGNABLE_REFERENCE_TYPE
-
-
Constructor Details
-
ReferenceTypeImpl
-
ReferenceTypeImpl
public ReferenceTypeImpl(ResolvedReferenceTypeDeclaration typeDeclaration, List<ResolvedType> typeArguments)
-
-
Method Details
-
undeterminedParameters
public static ResolvedReferenceType undeterminedParameters(ResolvedReferenceTypeDeclaration typeDeclaration) -
create
protected ResolvedReferenceType create(ResolvedReferenceTypeDeclaration typeDeclaration, List<ResolvedType> typeParametersCorrected) - Specified by:
create
in classResolvedReferenceType
-
create
- Specified by:
create
in classResolvedReferenceType
-
asTypeParameter
-
isAssignableBy
This method checks if ThisType t = new OtherType() would compile.- Specified by:
isAssignableBy
in interfaceResolvedType
- Specified by:
isAssignableBy
in classResolvedReferenceType
-
isAssignableByReferenceType
-
getDeclaredMethods
Description copied from class:ResolvedReferenceType
Methods declared on this type.- Specified by:
getDeclaredMethods
in classResolvedReferenceType
-
toRawType
- Specified by:
toRawType
in classResolvedReferenceType
- Returns:
- A copy of the current reference type, without type parameters.
-
mention
Description copied from interface:ResolvedType
Does this type mention at all, directly or indirectly, the given type parameters? -
transformTypeParameters
Execute a transformation on all the type parameters of this element.- Specified by:
transformTypeParameters
in classResolvedReferenceType
-
getAllAncestors
Description copied from class:ResolvedReferenceType
Return all ancestors, that means all superclasses and interfaces. This list should always include Object (unless this is a reference to Object). The type typeParametersValues should be expressed in terms of this type typeParametersValues. The default order of presenting ancestors corresponds to a search in depth.For example, given:
class Foo<A, B> {} class Bar<C> extends Foo<C, String> {}
a call to getAllAncestors on a reference to Bar having type parameter Boolean should include Foo<Boolean, String>.
- Specified by:
getAllAncestors
in classResolvedReferenceType
-
getAllAncestors
public List<ResolvedReferenceType> getAllAncestors(Function<ResolvedReferenceTypeDeclaration, List<ResolvedReferenceType>> traverser) Description copied from class:ResolvedReferenceType
Return all ancestors, that means all superclasses and interfaces. This list should always include Object (unless this is a reference to Object). The type typeParametersValues should be expressed in terms of this type typeParametersValues.- Specified by:
getAllAncestors
in classResolvedReferenceType
-
getDirectAncestors
Description copied from class:ResolvedReferenceType
Return direct ancestors, that means the superclasses and interfaces implemented directly. This list should include Object if the class has no other superclass or the interface is not extending another interface. There is an exception for Object itself.- Specified by:
getDirectAncestors
in classResolvedReferenceType
-
deriveTypeParameters
- Specified by:
deriveTypeParameters
in classResolvedReferenceType
-
getDeclaredFields
Description copied from class:ResolvedReferenceType
Fields declared on this type.- Specified by:
getDeclaredFields
in classResolvedReferenceType
-