Class ReflectionClassDeclaration
java.lang.Object
com.github.javaparser.symbolsolver.logic.AbstractTypeDeclaration
com.github.javaparser.symbolsolver.logic.AbstractClassDeclaration
com.github.javaparser.symbolsolver.reflectionmodel.ReflectionClassDeclaration
- All Implemented Interfaces:
com.github.javaparser.resolution.declarations.AssociableToAST, com.github.javaparser.resolution.declarations.HasAccessSpecifier, com.github.javaparser.resolution.declarations.ResolvedClassDeclaration, com.github.javaparser.resolution.declarations.ResolvedDeclaration, com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration, com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration, com.github.javaparser.resolution.declarations.ResolvedTypeParametrizable, com.github.javaparser.resolution.logic.MethodResolutionCapability, MethodUsageResolutionCapability, SymbolResolutionCapability
public class ReflectionClassDeclaration
extends AbstractClassDeclaration
implements MethodUsageResolutionCapability, SymbolResolutionCapability
- Author:
- Federico Tomassetti
-
Field Summary
Fields inherited from interface com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
breadthFirstFunc, depthFirstFunc, JAVA_IO_SERIALIZABLE, JAVA_LANG_COMPARABLE, JAVA_LANG_ENUM, JAVA_LANG_OBJECT, JAVA_LANG_RECORD -
Constructor Summary
ConstructorsConstructorDescriptionReflectionClassDeclaration(Class<?> clazz, com.github.javaparser.resolution.TypeSolver typeSolver) Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.github.javaparser.ast.AccessSpecifierbooleancanBeAssignedTo(com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration other) Optional<com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration> booleanList<com.github.javaparser.resolution.declarations.ResolvedFieldDeclaration> List<com.github.javaparser.resolution.types.ResolvedReferenceType> getAncestors(boolean acceptIncompleteList) List<com.github.javaparser.resolution.declarations.ResolvedConstructorDeclaration> Set<com.github.javaparser.resolution.declarations.ResolvedMethodDeclaration> Public methodscom.github.javaparser.resolution.declarations.ResolvedFieldDeclarationList<com.github.javaparser.resolution.types.ResolvedReferenceType> getName()Optional<com.github.javaparser.resolution.types.ResolvedReferenceType> List<com.github.javaparser.resolution.declarations.ResolvedTypeParameterDeclaration> com.github.javaparser.resolution.types.ResolvedTypegetUsage(com.github.javaparser.ast.Node node) booleanhasDirectlyAnnotation(String canonicalName) booleaninthashCode()Set<com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration> booleanisAssignableBy(com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration other) booleanisAssignableBy(com.github.javaparser.resolution.types.ResolvedType type) booleanisClass()booleanisField()booleanbooleanbooleanisType()booleanprotected com.github.javaparser.resolution.types.ResolvedReferenceTypeobject()Protected methodscom.github.javaparser.resolution.model.SymbolReference<com.github.javaparser.resolution.declarations.ResolvedMethodDeclaration> solveMethod(String name, List<com.github.javaparser.resolution.types.ResolvedType> argumentsTypes, boolean staticOnly) Deprecated.Optional<com.github.javaparser.resolution.MethodUsage> solveMethodAsUsage(String name, List<com.github.javaparser.resolution.types.ResolvedType> argumentsTypes, com.github.javaparser.resolution.Context invokationContext, List<com.github.javaparser.resolution.types.ResolvedType> typeParameterValues) com.github.javaparser.resolution.model.SymbolReference<? extends com.github.javaparser.resolution.declarations.ResolvedValueDeclaration> solveSymbol(String name, com.github.javaparser.resolution.TypeSolver typeSolver) toString()Methods inherited from class AbstractClassDeclaration
asClass, getAllInterfaces, getAllSuperClasses, hasNameMethods inherited from class AbstractTypeDeclaration
getAllMethods, isFunctionalInterface, isRecordTypeMethods inherited from interface com.github.javaparser.resolution.declarations.AssociableToAST
toAst, toAstMethods inherited from interface com.github.javaparser.resolution.declarations.ResolvedDeclaration
asEnumConstant, asField, asMethod, asParameter, asTypePattern, isArrayLength, isEnumConstant, isMethod, isTypePattern, isVariableMethods inherited from interface com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
asReferenceType, findTypeParameter, getAllAncestors, getAllAncestors, getAllMethods, getAllNonStaticFields, getAllStaticFields, getAncestors, getDeclaredAnnotation, getDeclaredAnnotations, getDeclaredFields, getVisibleField, getVisibleFields, hasAnnotation, hasVisibleField, isFunctionalInterface, isInheritedAnnotation, isJavaLangEnum, isJavaLangObject, isJavaLangRecord, isReferenceTypeMethods inherited from interface com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration
asAnnotation, asEnum, asInterface, asRecord, asType, asTypeParameter, getId, getInternalType, hasInternalType, isAnnotation, isAnonymousClass, isEnum, isRecordMethods inherited from interface com.github.javaparser.resolution.declarations.ResolvedTypeParametrizable
isGeneric
-
Constructor Details
-
ReflectionClassDeclaration
public ReflectionClassDeclaration(Class<?> clazz, com.github.javaparser.resolution.TypeSolver typeSolver) Constructors
-
-
Method Details
-
getDeclaredMethods
public Set<com.github.javaparser.resolution.declarations.ResolvedMethodDeclaration> getDeclaredMethods()Public methods- Specified by:
getDeclaredMethodsin interfacecom.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
-
getAncestors
public List<com.github.javaparser.resolution.types.ResolvedReferenceType> getAncestors(boolean acceptIncompleteList) - Specified by:
getAncestorsin interfacecom.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
-
equals
-
hashCode
-
getPackageName
- Specified by:
getPackageNamein interfacecom.github.javaparser.resolution.declarations.ResolvedTypeDeclaration
-
getClassName
- Specified by:
getClassNamein interfacecom.github.javaparser.resolution.declarations.ResolvedTypeDeclaration
-
getQualifiedName
- Specified by:
getQualifiedNamein interfacecom.github.javaparser.resolution.declarations.ResolvedTypeDeclaration
-
solveMethod
@Deprecated public com.github.javaparser.resolution.model.SymbolReference<com.github.javaparser.resolution.declarations.ResolvedMethodDeclaration> solveMethod(String name, List<com.github.javaparser.resolution.types.ResolvedType> argumentsTypes, boolean staticOnly) Deprecated.- Specified by:
solveMethodin interfacecom.github.javaparser.resolution.logic.MethodResolutionCapability
-
toString
-
getUsage
public com.github.javaparser.resolution.types.ResolvedType getUsage(com.github.javaparser.ast.Node node) -
solveMethodAsUsage
public Optional<com.github.javaparser.resolution.MethodUsage> solveMethodAsUsage(String name, List<com.github.javaparser.resolution.types.ResolvedType> argumentsTypes, com.github.javaparser.resolution.Context invokationContext, List<com.github.javaparser.resolution.types.ResolvedType> typeParameterValues) - Specified by:
solveMethodAsUsagein interfaceMethodUsageResolutionCapability
-
canBeAssignedTo
public boolean canBeAssignedTo(com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration other) - Specified by:
canBeAssignedToin interfacecom.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
-
isAssignableBy
public boolean isAssignableBy(com.github.javaparser.resolution.types.ResolvedType type) - Specified by:
isAssignableByin interfacecom.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
-
isTypeParameter
public boolean isTypeParameter()- Specified by:
isTypeParameterin interfacecom.github.javaparser.resolution.declarations.ResolvedTypeDeclaration
-
getField
- Specified by:
getFieldin interfacecom.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
-
getAllFields
- Specified by:
getAllFieldsin interfacecom.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
-
solveSymbol
public com.github.javaparser.resolution.model.SymbolReference<? extends com.github.javaparser.resolution.declarations.ResolvedValueDeclaration> solveSymbol(String name, com.github.javaparser.resolution.TypeSolver typeSolver) - Specified by:
solveSymbolin interfaceSymbolResolutionCapability- Parameters:
name- Field / symbol name.typeSolver- Symbol solver to resolve type usage.- Returns:
- Symbol reference of the resolved value.
-
hasDirectlyAnnotation
- Specified by:
hasDirectlyAnnotationin interfacecom.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
-
hasField
- Specified by:
hasFieldin interfacecom.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
-
isAssignableBy
public boolean isAssignableBy(com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration other) - Specified by:
isAssignableByin interfacecom.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
-
getName
- Specified by:
getNamein interfacecom.github.javaparser.resolution.declarations.ResolvedDeclaration
-
isField
public boolean isField()- Specified by:
isFieldin interfacecom.github.javaparser.resolution.declarations.ResolvedDeclaration
-
isParameter
public boolean isParameter()- Specified by:
isParameterin interfacecom.github.javaparser.resolution.declarations.ResolvedDeclaration
-
isType
public boolean isType()- Specified by:
isTypein interfacecom.github.javaparser.resolution.declarations.ResolvedDeclaration- Specified by:
isTypein interfacecom.github.javaparser.resolution.declarations.ResolvedTypeDeclaration
-
isClass
public boolean isClass()- Specified by:
isClassin interfacecom.github.javaparser.resolution.declarations.ResolvedClassDeclaration- Specified by:
isClassin interfacecom.github.javaparser.resolution.declarations.ResolvedTypeDeclaration
-
getSuperClass
- Specified by:
getSuperClassin interfacecom.github.javaparser.resolution.declarations.ResolvedClassDeclaration
-
getInterfaces
- Specified by:
getInterfacesin interfacecom.github.javaparser.resolution.declarations.ResolvedClassDeclaration
-
isInterface
public boolean isInterface()- Specified by:
isInterfacein interfacecom.github.javaparser.resolution.declarations.ResolvedTypeDeclaration
-
getTypeParameters
public List<com.github.javaparser.resolution.declarations.ResolvedTypeParameterDeclaration> getTypeParameters()- Specified by:
getTypeParametersin interfacecom.github.javaparser.resolution.declarations.ResolvedTypeParametrizable
-
accessSpecifier
public com.github.javaparser.ast.AccessSpecifier accessSpecifier()- Specified by:
accessSpecifierin interfacecom.github.javaparser.resolution.declarations.HasAccessSpecifier
-
getConstructors
public List<com.github.javaparser.resolution.declarations.ResolvedConstructorDeclaration> getConstructors()- Specified by:
getConstructorsin interfacecom.github.javaparser.resolution.declarations.ResolvedClassDeclaration- Specified by:
getConstructorsin interfacecom.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
-
containerType
public Optional<com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration> containerType()- Specified by:
containerTypein interfacecom.github.javaparser.resolution.declarations.ResolvedTypeDeclaration
-
internalTypes
public Set<com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration> internalTypes()- Specified by:
internalTypesin interfacecom.github.javaparser.resolution.declarations.ResolvedTypeDeclaration
-
object
protected com.github.javaparser.resolution.types.ResolvedReferenceType object()Protected methods- Specified by:
objectin classAbstractClassDeclaration
-