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
-
-
Constructor Summary
Constructors Constructor Description JavaParserClassDeclaration(ClassOrInterfaceDeclaration wrappedNode, TypeSolver typeSolver)
-
Method Summary
-
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, isEnumConstant, isField, isMethod, isParameter, isVariable
-
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
asReferenceType, findTypeParameter, getAllAncestors, getAllMethods, getAllNonStaticFields, getAllStaticFields, getAncestors, getDeclaredFields, getField, getVisibleField, getVisibleFields, hasAnnotation, hasField, hasVisibleField, isFunctionalInterface
-
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration
asEnum, asInterface, asType, asTypeParameter, getId, getInternalType, hasInternalType, isAnonymousClass, isEnum, isType
-
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedTypeParametrizable
isGeneric
-
-
-
-
Constructor Detail
-
JavaParserClassDeclaration
public JavaParserClassDeclaration(ClassOrInterfaceDeclaration wrappedNode, TypeSolver typeSolver)
-
-
Method Detail
-
getAllFields
public List<ResolvedFieldDeclaration> 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 public Context 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
public ResolvedType getUsage(Node node)
-
getName
public String getName()
- Specified by:
getName
in interfaceResolvedDeclaration
-
getSuperClass
public ResolvedReferenceType getSuperClass()
- Specified by:
getSuperClass
in interfaceResolvedClassDeclaration
-
getInterfaces
public List<ResolvedReferenceType> getInterfaces()
- Specified by:
getInterfaces
in interfaceResolvedClassDeclaration
-
getConstructors
public List<ResolvedConstructorDeclaration> getConstructors()
- Specified by:
getConstructors
in interfaceResolvedClassDeclaration
- Specified by:
getConstructors
in interfaceResolvedReferenceTypeDeclaration
-
hasDirectlyAnnotation
public boolean hasDirectlyAnnotation(String canonicalName)
- Specified by:
hasDirectlyAnnotation
in interfaceResolvedReferenceTypeDeclaration
-
isInterface
public boolean isInterface()
- Specified by:
isInterface
in interfaceResolvedTypeDeclaration
-
getPackageName
public String getPackageName()
- Specified by:
getPackageName
in interfaceResolvedTypeDeclaration
-
getClassName
public String getClassName()
- Specified by:
getClassName
in interfaceResolvedTypeDeclaration
-
getQualifiedName
public String getQualifiedName()
- Specified by:
getQualifiedName
in interfaceResolvedTypeDeclaration
-
isAssignableBy
public boolean isAssignableBy(ResolvedReferenceTypeDeclaration other)
- Specified by:
isAssignableBy
in interfaceResolvedReferenceTypeDeclaration
-
isAssignableBy
public boolean isAssignableBy(ResolvedType type)
- Specified by:
isAssignableBy
in interfaceResolvedReferenceTypeDeclaration
-
canBeAssignedTo
public boolean canBeAssignedTo(ResolvedReferenceTypeDeclaration other)
- Specified by:
canBeAssignedTo
in interfaceResolvedReferenceTypeDeclaration
-
isTypeParameter
public boolean isTypeParameter()
- Specified by:
isTypeParameter
in interfaceResolvedTypeDeclaration
-
solveType
@Deprecated public SymbolReference<ResolvedTypeDeclaration> solveType(String name)
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
public List<ResolvedReferenceType> getAncestors(boolean acceptIncompleteList)
- Specified by:
getAncestors
in interfaceResolvedReferenceTypeDeclaration
-
getDeclaredMethods
public Set<ResolvedMethodDeclaration> getDeclaredMethods()
- Specified by:
getDeclaredMethods
in interfaceResolvedReferenceTypeDeclaration
-
getTypeParameters
public List<ResolvedTypeParameterDeclaration> getTypeParameters()
- Specified by:
getTypeParameters
in interfaceResolvedTypeParametrizable
-
getWrappedNode
public ClassOrInterfaceDeclaration getWrappedNode()
Returns the JavaParser node associated with this JavaParserClassDeclaration.- Returns:
- A visitable JavaParser node wrapped by this object.
-
accessSpecifier
public AccessSpecifier accessSpecifier()
- Specified by:
accessSpecifier
in interfaceHasAccessSpecifier
-
toAst
public Optional<Node> toAst()
- Specified by:
toAst
in interfaceAssociableToAST<Node>
-
object
protected ResolvedReferenceType object()
Description copied from class:AbstractClassDeclaration
An implementation of the Object class.- Specified by:
object
in classAbstractClassDeclaration
-
internalTypes
public Set<ResolvedReferenceTypeDeclaration> internalTypes()
- Specified by:
internalTypes
in interfaceResolvedTypeDeclaration
-
containerType
public Optional<ResolvedReferenceTypeDeclaration> containerType()
- Specified by:
containerType
in interfaceResolvedTypeDeclaration
-
-