Class JavaParserEnumDeclaration
java.lang.Object
com.github.javaparser.symbolsolver.logic.AbstractTypeDeclaration
com.github.javaparser.symbolsolver.javaparsermodel.declarations.JavaParserEnumDeclaration
- All Implemented Interfaces:
AssociableToAST<EnumDeclaration>
,HasAccessSpecifier
,ResolvedDeclaration
,ResolvedEnumDeclaration
,ResolvedReferenceTypeDeclaration
,ResolvedTypeDeclaration
,ResolvedTypeParametrizable
,MethodUsageResolutionCapability
,SymbolResolutionCapability
,MethodResolutionCapability
public class JavaParserEnumDeclaration
extends AbstractTypeDeclaration
implements ResolvedEnumDeclaration, MethodResolutionCapability, MethodUsageResolutionCapability, SymbolResolutionCapability, AssociableToAST<EnumDeclaration>
- Author:
- Federico Tomassetti
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Needed by ContextHelper An implicitly declared methodpublic static E valueOf(String name)
, which returns the enum constant ofE
with the specified name.static class
Needed by ContextHelper An implicitly declared methodpublic static E[] values()
, which returns an array containing the enum constants ofE
, in the same order as they appear in the body of the declaration of E. -
Field Summary
Fields inherited from interface com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
breadthFirstFunc, depthFirstFunc, JAVA_LANG_OBJECT
-
Constructor Summary
ConstructorsConstructorDescriptionJavaParserEnumDeclaration(EnumDeclaration wrappedNode, TypeSolver typeSolver)
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
getAncestors(boolean acceptIncompleteList)
getName()
Returns the JavaParser node associated with this JavaParserEnumDeclaration.boolean
hasDirectlyAnnotation(String canonicalName)
int
hashCode()
boolean
boolean
isAssignableBy(ResolvedType type)
boolean
isClass()
boolean
isField()
boolean
boolean
boolean
isType()
boolean
solveMethod(String name, List<ResolvedType> argumentsTypes, boolean staticOnly)
solveMethodAsUsage(String name, List<ResolvedType> argumentTypes, Context invokationContext, List<ResolvedType> typeParameters)
SymbolReference<? extends ResolvedValueDeclaration>
solveSymbol(String name, TypeSolver typeSolver)
Deprecated.toAst()
toString()
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, asPattern, hasName, isEnumConstant, isMethod, isPattern, 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, 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, asClass, asInterface, asType, asTypeParameter, getId, getInternalType, hasInternalType, isAnnotation, isAnonymousClass
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedTypeParametrizable
isGeneric
-
Constructor Details
-
JavaParserEnumDeclaration
-
-
Method Details
-
toString
-
getDeclaredMethods
- Specified by:
getDeclaredMethods
in interfaceResolvedReferenceTypeDeclaration
-
getContext
-
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
- Specified by:
hasDirectlyAnnotation
in interfaceResolvedReferenceTypeDeclaration
-
canBeAssignedTo
- Specified by:
canBeAssignedTo
in interfaceResolvedReferenceTypeDeclaration
-
isClass
public boolean isClass()- Specified by:
isClass
in interfaceResolvedTypeDeclaration
-
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
-
isTypeParameter
public boolean isTypeParameter()- Specified by:
isTypeParameter
in interfaceResolvedTypeDeclaration
-
equals
-
hashCode
public int hashCode() -
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
-
solveSymbol
public SymbolReference<? extends ResolvedValueDeclaration> solveSymbol(String name, TypeSolver typeSolver)- Specified by:
solveSymbol
in interfaceSymbolResolutionCapability
- Parameters:
name
- Field / symbol name.typeSolver
- Symbol solver to resolve type usage.- Returns:
- Symbol reference of the resolved value.
-
getAllFields
- Specified by:
getAllFields
in interfaceResolvedReferenceTypeDeclaration
-
getAncestors
- Specified by:
getAncestors
in interfaceResolvedReferenceTypeDeclaration
-
solveType
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
- Specified by:
getTypeParameters
in interfaceResolvedTypeParametrizable
-
getWrappedNode
Returns the JavaParser node associated with this JavaParserEnumDeclaration.- Returns:
- A visitable JavaParser node wrapped by this object.
-
getEnumConstants
- Specified by:
getEnumConstants
in interfaceResolvedEnumDeclaration
-
accessSpecifier
- Specified by:
accessSpecifier
in interfaceHasAccessSpecifier
-
internalTypes
- Specified by:
internalTypes
in interfaceResolvedTypeDeclaration
-
containerType
- Specified by:
containerType
in interfaceResolvedTypeDeclaration
-
getConstructors
- Specified by:
getConstructors
in interfaceResolvedReferenceTypeDeclaration
-
toAst
- Specified by:
toAst
in interfaceAssociableToAST<EnumDeclaration>
-