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,MethodResolutionCapability
public class JavaParserEnumDeclaration
extends AbstractTypeDeclaration
implements ResolvedEnumDeclaration, MethodResolutionCapability, MethodUsageResolutionCapability, AssociableToAST<EnumDeclaration>
- Author:
- Federico Tomassetti
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classNeeded by ContextHelper An implicitly declared methodpublic static E valueOf(String name), which returns the enum constant ofEwith the specified name.static classNeeded 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 TypeMethodDescriptionbooleanbooleangetAncestors(boolean acceptIncompleteList)getName()Returns the JavaParser node associated with this JavaParserEnumDeclaration.booleanhasDirectlyAnnotation(String canonicalName)inthashCode()booleanbooleanisAssignableBy(ResolvedType type)booleanisClass()booleanisField()booleanbooleanbooleanisType()booleansolveMethod(String name, List<ResolvedType> argumentsTypes, boolean staticOnly)solveMethodAsUsage(String name, List<ResolvedType> argumentTypes, Context invokationContext, List<ResolvedType> typeParameters)Deprecated.toAst()toString()Methods inherited from class com.github.javaparser.symbolsolver.logic.AbstractTypeDeclaration
getAllMethods, isFunctionalInterfaceMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.github.javaparser.resolution.declarations.ResolvedDeclaration
asEnumConstant, asField, asMethod, asParameter, asPattern, hasName, isEnumConstant, isMethod, isPattern, isVariableMethods inherited from interface com.github.javaparser.resolution.declarations.ResolvedEnumDeclaration
asEnum, getEnumConstant, hasEnumConstant, isEnumMethods 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, isJavaLangObjectMethods inherited from interface com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration
asAnnotation, asClass, asInterface, asType, asTypeParameter, getId, getInternalType, hasInternalType, isAnnotation, isAnonymousClassMethods inherited from interface com.github.javaparser.resolution.declarations.ResolvedTypeParametrizable
isGeneric
-
Constructor Details
-
JavaParserEnumDeclaration
-
-
Method Details
-
toString
-
getDeclaredMethods
- Specified by:
getDeclaredMethodsin interfaceResolvedReferenceTypeDeclaration
-
getContext
-
getName
- Specified by:
getNamein interfaceResolvedDeclaration
-
isField
public boolean isField()- Specified by:
isFieldin interfaceResolvedDeclaration
-
isParameter
public boolean isParameter()- Specified by:
isParameterin interfaceResolvedDeclaration
-
isType
public boolean isType()- Specified by:
isTypein interfaceResolvedDeclaration- Specified by:
isTypein interfaceResolvedTypeDeclaration
-
hasDirectlyAnnotation
- Specified by:
hasDirectlyAnnotationin interfaceResolvedReferenceTypeDeclaration
-
canBeAssignedTo
- Specified by:
canBeAssignedToin interfaceResolvedReferenceTypeDeclaration
-
isClass
public boolean isClass()- Specified by:
isClassin interfaceResolvedTypeDeclaration
-
isInterface
public boolean isInterface()- Specified by:
isInterfacein interfaceResolvedTypeDeclaration
-
getPackageName
- Specified by:
getPackageNamein interfaceResolvedTypeDeclaration
-
getClassName
- Specified by:
getClassNamein interfaceResolvedTypeDeclaration
-
getQualifiedName
- Specified by:
getQualifiedNamein interfaceResolvedTypeDeclaration
-
isAssignableBy
- Specified by:
isAssignableByin interfaceResolvedReferenceTypeDeclaration
-
isAssignableBy
- Specified by:
isAssignableByin interfaceResolvedReferenceTypeDeclaration
-
isTypeParameter
public boolean isTypeParameter()- Specified by:
isTypeParameterin interfaceResolvedTypeDeclaration
-
equals
-
hashCode
public int hashCode() -
solveMethodAsUsage
public Optional<MethodUsage> solveMethodAsUsage(String name, List<ResolvedType> argumentTypes, Context invokationContext, List<ResolvedType> typeParameters)- Specified by:
solveMethodAsUsagein interfaceMethodUsageResolutionCapability
-
solveMethod
public SymbolReference<ResolvedMethodDeclaration> solveMethod(String name, List<ResolvedType> argumentsTypes, boolean staticOnly)- Specified by:
solveMethodin interfaceMethodResolutionCapability
-
getAllFields
- Specified by:
getAllFieldsin interfaceResolvedReferenceTypeDeclaration
-
getAncestors
- Specified by:
getAncestorsin 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:
getTypeParametersin interfaceResolvedTypeParametrizable
-
getWrappedNode
Returns the JavaParser node associated with this JavaParserEnumDeclaration.- Returns:
- A visitable JavaParser node wrapped by this object.
-
getEnumConstants
- Specified by:
getEnumConstantsin interfaceResolvedEnumDeclaration
-
accessSpecifier
- Specified by:
accessSpecifierin interfaceHasAccessSpecifier
-
internalTypes
- Specified by:
internalTypesin interfaceResolvedTypeDeclaration
-
containerType
- Specified by:
containerTypein interfaceResolvedTypeDeclaration
-
getConstructors
- Specified by:
getConstructorsin interfaceResolvedReferenceTypeDeclaration
-
toAst
- Specified by:
toAstin interfaceAssociableToAST<EnumDeclaration>
-