Class JavaParserClassDeclaration
java.lang.Object
com.github.javaparser.symbolsolver.logic.AbstractTypeDeclaration
com.github.javaparser.symbolsolver.logic.AbstractClassDeclaration
com.github.javaparser.symbolsolver.javaparsermodel.declarations.JavaParserClassDeclaration
- All Implemented Interfaces:
AssociableToAST<Node>
,HasAccessSpecifier
,ResolvedClassDeclaration
,ResolvedDeclaration
,ResolvedReferenceTypeDeclaration
,ResolvedTypeDeclaration
,ResolvedTypeParametrizable
,MethodUsageResolutionCapability
,MethodResolutionCapability
public class JavaParserClassDeclaration
extends AbstractClassDeclaration
implements MethodUsageResolutionCapability
- Author:
- Federico Tomassetti
-
Field Summary
Fields inherited from interface com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
breadthFirstFunc, depthFirstFunc, JAVA_LANG_ENUM, JAVA_LANG_OBJECT
-
Constructor Summary
ConstructorsConstructorDescriptionJavaParserClassDeclaration(ClassOrInterfaceDeclaration wrappedNode, TypeSolver typeSolver)
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
getAncestors(boolean acceptIncompleteList)
Deprecated.getName()
Returns the JavaParser node associated with this JavaParserClassDeclaration.boolean
hasDirectlyAnnotation(String canonicalName)
int
hashCode()
boolean
boolean
isAssignableBy(ResolvedType type)
boolean
boolean
protected ResolvedReferenceType
object()
An implementation of the Object class.solveMethod(String name, List<ResolvedType> parameterTypes)
solveMethod(String name, List<ResolvedType> argumentsTypes, boolean staticOnly)
solveMethodAsUsage(String name, List<ResolvedType> argumentTypes, Context invocationContext, List<ResolvedType> typeParameters)
Deprecated.toAst()
toString()
Methods inherited from class com.github.javaparser.symbolsolver.logic.AbstractClassDeclaration
asClass, getAllInterfaces, getAllSuperClasses, hasName
Methods inherited from class com.github.javaparser.symbolsolver.logic.AbstractTypeDeclaration
getAllMethods, isFunctionalInterface
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedClassDeclaration
isClass
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedDeclaration
asEnumConstant, asField, asMethod, asParameter, asPattern, isEnumConstant, isField, isMethod, isParameter, isPattern, isVariable
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
asReferenceType, findTypeParameter, getAllAncestors, getAllAncestors, getAllMethods, getAllNonStaticFields, getAllStaticFields, getAncestors, getDeclaredFields, getField, getVisibleField, getVisibleFields, hasAnnotation, hasField, hasVisibleField, isFunctionalInterface, isJavaLangEnum, isJavaLangObject
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration
asAnnotation, asEnum, asInterface, asType, asTypeParameter, getId, getInternalType, hasInternalType, isAnnotation, isAnonymousClass, isEnum, isType
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedTypeParametrizable
isGeneric
-
Constructor Details
-
JavaParserClassDeclaration
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
toString
-
getAllFields
- Specified by:
getAllFields
in interfaceResolvedReferenceTypeDeclaration
-
solveMethod
public SymbolReference<ResolvedMethodDeclaration> solveMethod(String name, List<ResolvedType> parameterTypes) -
solveMethodAsUsage
public Optional<MethodUsage> solveMethodAsUsage(String name, List<ResolvedType> argumentTypes, Context invocationContext, List<ResolvedType> typeParameters)- Specified by:
solveMethodAsUsage
in interfaceMethodUsageResolutionCapability
-
getContext
Deprecated.This method is deprecated because the context is an implementation detail that should not be exposed. Ideally this method should become private. For this reason all further usages of this method are discouraged. -
getUsage
-
getName
- Specified by:
getName
in interfaceResolvedDeclaration
-
getSuperClass
- Specified by:
getSuperClass
in interfaceResolvedClassDeclaration
-
getInterfaces
- Specified by:
getInterfaces
in interfaceResolvedClassDeclaration
-
getConstructors
- Specified by:
getConstructors
in interfaceResolvedClassDeclaration
- Specified by:
getConstructors
in interfaceResolvedReferenceTypeDeclaration
-
hasDirectlyAnnotation
- Specified by:
hasDirectlyAnnotation
in interfaceResolvedReferenceTypeDeclaration
-
isInterface
public boolean isInterface()- Specified by:
isInterface
in interfaceResolvedTypeDeclaration
-
getPackageName
- Specified by:
getPackageName
in interfaceResolvedTypeDeclaration
-
getClassName
- Specified by:
getClassName
in interfaceResolvedTypeDeclaration
-
getQualifiedName
- Specified by:
getQualifiedName
in interfaceResolvedTypeDeclaration
-
isAssignableBy
- Specified by:
isAssignableBy
in interfaceResolvedReferenceTypeDeclaration
-
isAssignableBy
- Specified by:
isAssignableBy
in interfaceResolvedReferenceTypeDeclaration
-
canBeAssignedTo
- Specified by:
canBeAssignedTo
in interfaceResolvedReferenceTypeDeclaration
-
isTypeParameter
public boolean isTypeParameter()- Specified by:
isTypeParameter
in interfaceResolvedTypeDeclaration
-
solveType
Deprecated.Resolution should move out of declarations, so that they are pure declarations and the resolution should work for JavaParser, Reflection and Javassist classes in the same way and not be specific to the three implementations. -
solveMethod
public SymbolReference<ResolvedMethodDeclaration> solveMethod(String name, List<ResolvedType> argumentsTypes, boolean staticOnly)- Specified by:
solveMethod
in interfaceMethodResolutionCapability
-
getAncestors
- Specified by:
getAncestors
in interfaceResolvedReferenceTypeDeclaration
-
getDeclaredMethods
- Specified by:
getDeclaredMethods
in interfaceResolvedReferenceTypeDeclaration
-
getTypeParameters
- Specified by:
getTypeParameters
in interfaceResolvedTypeParametrizable
-
getWrappedNode
Returns the JavaParser node associated with this JavaParserClassDeclaration.- Returns:
- A visitable JavaParser node wrapped by this object.
-
accessSpecifier
- Specified by:
accessSpecifier
in interfaceHasAccessSpecifier
-
toAst
- Specified by:
toAst
in interfaceAssociableToAST<Node>
-
object
Description copied from class:AbstractClassDeclaration
An implementation of the Object class.- Specified by:
object
in classAbstractClassDeclaration
-
internalTypes
- Specified by:
internalTypes
in interfaceResolvedTypeDeclaration
-
containerType
- Specified by:
containerType
in interfaceResolvedTypeDeclaration
-