Class JavaParserInterfaceDeclaration
java.lang.Object
com.github.javaparser.symbolsolver.logic.AbstractTypeDeclaration
com.github.javaparser.symbolsolver.javaparsermodel.declarations.JavaParserInterfaceDeclaration
- All Implemented Interfaces:
AssociableToAST<ClassOrInterfaceDeclaration>
,HasAccessSpecifier
,ResolvedDeclaration
,ResolvedInterfaceDeclaration
,ResolvedReferenceTypeDeclaration
,ResolvedTypeDeclaration
,ResolvedTypeParametrizable
,MethodUsageResolutionCapability
,SymbolResolutionCapability
,MethodResolutionCapability
public class JavaParserInterfaceDeclaration
extends AbstractTypeDeclaration
implements ResolvedInterfaceDeclaration, MethodResolutionCapability, MethodUsageResolutionCapability, SymbolResolutionCapability
- 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
ConstructorsConstructorDescriptionJavaParserInterfaceDeclaration(ClassOrInterfaceDeclaration wrappedNode, TypeSolver typeSolver)
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
getAncestors(boolean acceptIncompleteList)
getName()
Returns the JavaParser node associated with this JavaParserInterfaceDeclaration.boolean
hasDirectlyAnnotation(String canonicalName)
int
hashCode()
boolean
boolean
isAssignableBy(ResolvedType type)
boolean
boolean
solveMethod(String name, List<ResolvedType> argumentsTypes, boolean staticOnly)
solveMethodAsUsage(String name, List<ResolvedType> argumentTypes, Context invocationContext, 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, isField, isMethod, isParameter, isPattern, isVariable
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedInterfaceDeclaration
getAllInterfacesExtended
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, asEnum, asType, asTypeParameter, getId, getInternalType, hasInternalType, isAnnotation, isAnonymousClass, isClass, isEnum, isType
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedTypeParametrizable
isGeneric
-
Constructor Details
-
JavaParserInterfaceDeclaration
public JavaParserInterfaceDeclaration(ClassOrInterfaceDeclaration wrappedNode, TypeSolver typeSolver)
-
-
Method Details
-
getDeclaredMethods
- Specified by:
getDeclaredMethods
in interfaceResolvedReferenceTypeDeclaration
-
getContext
-
getUsage
-
equals
-
hashCode
public int hashCode() -
getName
- Specified by:
getName
in interfaceResolvedDeclaration
-
asInterface
- Specified by:
asInterface
in interfaceResolvedTypeDeclaration
-
hasDirectlyAnnotation
- Specified by:
hasDirectlyAnnotation
in interfaceResolvedReferenceTypeDeclaration
-
isInterface
public boolean isInterface()- Specified by:
isInterface
in interfaceResolvedInterfaceDeclaration
- Specified by:
isInterface
in interfaceResolvedTypeDeclaration
-
getInterfacesExtended
- Specified by:
getInterfacesExtended
in interfaceResolvedInterfaceDeclaration
-
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
-
getAllFields
- Specified by:
getAllFields
in interfaceResolvedReferenceTypeDeclaration
-
toString
-
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. -
solveMethod
public SymbolReference<ResolvedMethodDeclaration> solveMethod(String name, List<ResolvedType> argumentsTypes, boolean staticOnly)- Specified by:
solveMethod
in interfaceMethodResolutionCapability
-
solveMethodAsUsage
public Optional<MethodUsage> solveMethodAsUsage(String name, List<ResolvedType> argumentTypes, Context invocationContext, List<ResolvedType> typeParameters)- Specified by:
solveMethodAsUsage
in interfaceMethodUsageResolutionCapability
-
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.
-
getAncestors
- Specified by:
getAncestors
in interfaceResolvedReferenceTypeDeclaration
-
getTypeParameters
- Specified by:
getTypeParameters
in interfaceResolvedTypeParametrizable
-
getWrappedNode
Returns the JavaParser node associated with this JavaParserInterfaceDeclaration.- Returns:
- A visitable JavaParser node wrapped by this object.
-
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<ClassOrInterfaceDeclaration>
-