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,MethodResolutionCapability
public class JavaParserInterfaceDeclaration extends AbstractTypeDeclaration implements ResolvedInterfaceDeclaration, MethodResolutionCapability, MethodUsageResolutionCapability
- Author:
- Federico Tomassetti
-
-
Constructor Summary
Constructors Constructor Description JavaParserInterfaceDeclaration(ClassOrInterfaceDeclaration 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, isField, isMethod, isParameter, 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, getAllMethods, getAllNonStaticFields, getAllStaticFields, getAncestors, getDeclaredFields, getField, getVisibleField, getVisibleFields, hasAnnotation, hasField, hasVisibleField, isFunctionalInterface
-
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration
asClass, asEnum, asType, asTypeParameter, getId, getInternalType, hasInternalType, isAnonymousClass, isClass, isEnum, isType
-
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedTypeParametrizable
isGeneric
-
-
-
-
Constructor Detail
-
JavaParserInterfaceDeclaration
public JavaParserInterfaceDeclaration(ClassOrInterfaceDeclaration wrappedNode, TypeSolver typeSolver)
-
-
Method Detail
-
getDeclaredMethods
public Set<ResolvedMethodDeclaration> getDeclaredMethods()
- Specified by:
getDeclaredMethodsin interfaceResolvedReferenceTypeDeclaration
-
getContext
public Context getContext()
-
getUsage
public ResolvedType getUsage(Node node)
-
getName
public String getName()
- Specified by:
getNamein interfaceResolvedDeclaration
-
asInterface
public ResolvedInterfaceDeclaration asInterface()
- Specified by:
asInterfacein interfaceResolvedTypeDeclaration
-
hasDirectlyAnnotation
public boolean hasDirectlyAnnotation(String canonicalName)
- Specified by:
hasDirectlyAnnotationin interfaceResolvedReferenceTypeDeclaration
-
isInterface
public boolean isInterface()
- Specified by:
isInterfacein interfaceResolvedInterfaceDeclaration- Specified by:
isInterfacein interfaceResolvedTypeDeclaration
-
getInterfacesExtended
public List<ResolvedReferenceType> getInterfacesExtended()
- Specified by:
getInterfacesExtendedin interfaceResolvedInterfaceDeclaration
-
getPackageName
public String getPackageName()
- Specified by:
getPackageNamein interfaceResolvedTypeDeclaration
-
getClassName
public String getClassName()
- Specified by:
getClassNamein interfaceResolvedTypeDeclaration
-
getQualifiedName
public String getQualifiedName()
- Specified by:
getQualifiedNamein interfaceResolvedTypeDeclaration
-
isAssignableBy
public boolean isAssignableBy(ResolvedReferenceTypeDeclaration other)
- Specified by:
isAssignableByin interfaceResolvedReferenceTypeDeclaration
-
isAssignableBy
public boolean isAssignableBy(ResolvedType type)
- Specified by:
isAssignableByin interfaceResolvedReferenceTypeDeclaration
-
canBeAssignedTo
public boolean canBeAssignedTo(ResolvedReferenceTypeDeclaration other)
- Specified by:
canBeAssignedToin interfaceResolvedReferenceTypeDeclaration
-
isTypeParameter
public boolean isTypeParameter()
- Specified by:
isTypeParameterin interfaceResolvedTypeDeclaration
-
getAllFields
public List<ResolvedFieldDeclaration> getAllFields()
- Specified by:
getAllFieldsin 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.
-
solveMethod
public SymbolReference<ResolvedMethodDeclaration> solveMethod(String name, List<ResolvedType> argumentsTypes, boolean staticOnly)
- Specified by:
solveMethodin interfaceMethodResolutionCapability
-
solveMethodAsUsage
public Optional<MethodUsage> solveMethodAsUsage(String name, List<ResolvedType> argumentTypes, Context invocationContext, List<ResolvedType> typeParameters)
- Specified by:
solveMethodAsUsagein interfaceMethodUsageResolutionCapability
-
getAncestors
public List<ResolvedReferenceType> getAncestors(boolean acceptIncompleteList)
- Specified by:
getAncestorsin interfaceResolvedReferenceTypeDeclaration
-
getTypeParameters
public List<ResolvedTypeParameterDeclaration> getTypeParameters()
- Specified by:
getTypeParametersin interfaceResolvedTypeParametrizable
-
getWrappedNode
public ClassOrInterfaceDeclaration getWrappedNode()
Returns the JavaParser node associated with this JavaParserInterfaceDeclaration.- Returns:
- A visitable JavaParser node wrapped by this object.
-
accessSpecifier
public AccessSpecifier accessSpecifier()
- Specified by:
accessSpecifierin interfaceHasAccessSpecifier
-
internalTypes
public Set<ResolvedReferenceTypeDeclaration> internalTypes()
- Specified by:
internalTypesin interfaceResolvedTypeDeclaration
-
containerType
public Optional<ResolvedReferenceTypeDeclaration> containerType()
- Specified by:
containerTypein interfaceResolvedTypeDeclaration
-
getConstructors
public List<ResolvedConstructorDeclaration> getConstructors()
- Specified by:
getConstructorsin interfaceResolvedReferenceTypeDeclaration
-
toAst
public Optional<ClassOrInterfaceDeclaration> toAst()
- Specified by:
toAstin interfaceAssociableToAST<ClassOrInterfaceDeclaration>
-
-