Class JavaParserEnumDeclaration
- java.lang.Object
-
- com.github.javaparser.symbolsolver.logic.AbstractTypeDeclaration
-
- com.github.javaparser.symbolsolver.javaparsermodel.declarations.JavaParserEnumDeclaration
-
- All Implemented Interfaces:
HasAccessSpecifier
,ResolvedDeclaration
,ResolvedEnumDeclaration
,ResolvedReferenceTypeDeclaration
,ResolvedTypeDeclaration
,ResolvedTypeParametrizable
,MethodUsageResolutionCapability
,MethodResolutionCapability
public class JavaParserEnumDeclaration extends AbstractTypeDeclaration implements ResolvedEnumDeclaration, MethodResolutionCapability, MethodUsageResolutionCapability
- Author:
- Federico Tomassetti
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JavaParserEnumDeclaration.ValuesMethod
-
Constructor Summary
Constructors Constructor Description JavaParserEnumDeclaration(EnumDeclaration wrappedNode, TypeSolver typeSolver)
-
Method Summary
-
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.ResolvedDeclaration
asEnumConstant, asField, asMethod, asParameter, hasName, isEnumConstant, isMethod, isVariable
-
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedEnumDeclaration
asEnum, getEnumConstant, hasEnumConstant, isEnum
-
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
asClass, asInterface, asType, asTypeParameter, getId, getInternalType, hasInternalType, isAnonymousClass
-
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedTypeParametrizable
isGeneric
-
-
-
-
Constructor Detail
-
JavaParserEnumDeclaration
public JavaParserEnumDeclaration(EnumDeclaration wrappedNode, TypeSolver typeSolver)
-
-
Method Detail
-
getDeclaredMethods
public Set<ResolvedMethodDeclaration> getDeclaredMethods()
- Specified by:
getDeclaredMethods
in interfaceResolvedReferenceTypeDeclaration
-
getContext
public Context getContext()
-
getName
public String getName()
- Specified by:
getName
in interfaceResolvedDeclaration
-
isField
public boolean isField()
- Specified by:
isField
in interfaceResolvedDeclaration
-
isParameter
public boolean isParameter()
- Specified by:
isParameter
in interfaceResolvedDeclaration
-
isType
public boolean isType()
- Specified by:
isType
in interfaceResolvedDeclaration
- Specified by:
isType
in interfaceResolvedTypeDeclaration
-
hasDirectlyAnnotation
public boolean hasDirectlyAnnotation(String canonicalName)
- Specified by:
hasDirectlyAnnotation
in interfaceResolvedReferenceTypeDeclaration
-
canBeAssignedTo
public boolean canBeAssignedTo(ResolvedReferenceTypeDeclaration other)
- Specified by:
canBeAssignedTo
in interfaceResolvedReferenceTypeDeclaration
-
isClass
public boolean isClass()
- Specified by:
isClass
in interfaceResolvedTypeDeclaration
-
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
-
isTypeParameter
public boolean isTypeParameter()
- Specified by:
isTypeParameter
in interfaceResolvedTypeDeclaration
-
solveMethodAsUsage
public Optional<MethodUsage> solveMethodAsUsage(String name, List<ResolvedType> argumentTypes, Context invokationContext, List<ResolvedType> typeParameters)
- Specified by:
solveMethodAsUsage
in interfaceMethodUsageResolutionCapability
-
solveMethod
public SymbolReference<ResolvedMethodDeclaration> solveMethod(String name, List<ResolvedType> argumentsTypes, boolean staticOnly)
- Specified by:
solveMethod
in interfaceMethodResolutionCapability
-
getAllFields
public List<ResolvedFieldDeclaration> getAllFields()
- Specified by:
getAllFields
in interfaceResolvedReferenceTypeDeclaration
-
getAncestors
public List<ResolvedReferenceType> getAncestors(boolean acceptIncompleteList)
- Specified by:
getAncestors
in interfaceResolvedReferenceTypeDeclaration
-
solveType
@Deprecated public SymbolReference<ResolvedTypeDeclaration> solveType(String name)
Deprecated.This method is deprecated because it receives the TypesSolver as a parameter. Eventually we would like to remove all usages of TypeSolver as a parameter. Also, 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.
-
getTypeParameters
public List<ResolvedTypeParameterDeclaration> getTypeParameters()
- Specified by:
getTypeParameters
in interfaceResolvedTypeParametrizable
-
getWrappedNode
public EnumDeclaration getWrappedNode()
Returns the JavaParser node associated with this JavaParserEnumDeclaration.- Returns:
- A visitable JavaParser node wrapped by this object.
-
getEnumConstants
public List<ResolvedEnumConstantDeclaration> getEnumConstants()
- Specified by:
getEnumConstants
in interfaceResolvedEnumDeclaration
-
accessSpecifier
public AccessSpecifier accessSpecifier()
- Specified by:
accessSpecifier
in interfaceHasAccessSpecifier
-
internalTypes
public Set<ResolvedReferenceTypeDeclaration> internalTypes()
- Specified by:
internalTypes
in interfaceResolvedTypeDeclaration
-
containerType
public Optional<ResolvedReferenceTypeDeclaration> containerType()
- Specified by:
containerType
in interfaceResolvedTypeDeclaration
-
getConstructors
public List<ResolvedConstructorDeclaration> getConstructors()
- Specified by:
getConstructors
in interfaceResolvedReferenceTypeDeclaration
-
-