Class JavassistInterfaceDeclaration
java.lang.Object
com.github.javaparser.symbolsolver.logic.AbstractTypeDeclaration
com.github.javaparser.symbolsolver.javassistmodel.JavassistInterfaceDeclaration
- All Implemented Interfaces:
AssociableToAST, HasAccessSpecifier, ResolvedDeclaration, ResolvedInterfaceDeclaration, ResolvedReferenceTypeDeclaration, ResolvedTypeDeclaration, ResolvedTypeParametrizable, MethodResolutionCapability, MethodUsageResolutionCapability, SymbolResolutionCapability
public class JavassistInterfaceDeclaration
extends AbstractTypeDeclaration
implements ResolvedInterfaceDeclaration, MethodResolutionCapability, MethodUsageResolutionCapability, SymbolResolutionCapability
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate javassist.CtClassprivate JavassistTypeDeclarationAdapterprivate TypeSolverFields inherited from interface ResolvedReferenceTypeDeclaration
breadthFirstFunc, depthFirstFunc, JAVA_IO_SERIALIZABLE, JAVA_LANG_COMPARABLE, JAVA_LANG_ENUM, JAVA_LANG_OBJECT, JAVA_LANG_RECORD -
Constructor Summary
ConstructorsConstructorDescriptionJavassistInterfaceDeclaration(javassist.CtClass ctClass, TypeSolver typeSolver) -
Method Summary
Modifier and TypeMethodDescriptionThe access specifier of this element.Return this as a InterfaceDeclaration or throw UnsupportedOperationException.booleanCan we assign instances of the type defined by this declaration to variables having the type defined by the given type?Get the ReferenceTypeDeclaration enclosing this declaration.Return a list of all fields, either declared in this declaration or inherited.getAncestors(boolean acceptIncompleteList) Resolves the types of all direct ancestors (i.e., the directly extended class and the directly implemented interfaces) and returns the list of ancestors as a list of resolved reference types.The class(es) wrapping this type.Return a collection of all annotations declared in this type declaration.Return a list of all the methods declared in this type declaration.private String[]Return the list of interfaces extended directly by this one.getInternalType(String name) Returns a type declaration for the internal type based on name.getName()Should return the name or return null if the name is not available.The package name of the type.The fully qualified name of the type declared.The list of type parameters defined on this element.booleanhasDirectlyAnnotation(String canonicalName) Has the type at least one annotation declared having the specified qualified name?booleanhasInternalType(String name) Does this type contain an internal type with the given name? (Does not include internal types inside internal types).Get the list of types defined inside the current type.booleanCan we assign instances of the given type to variables having the type defined by this declaration?booleanisAssignableBy(ResolvedType type) Can we assign instances of the given type to variables having the type defined by this declaration?solveMethod(String name, List<ResolvedType> argumentsTypes, boolean staticOnly) Deprecated.solveMethodAsUsage(String name, List<ResolvedType> argumentsTypes, Context invokationContext, List<ResolvedType> typeParameterValues) Deprecated.SymbolReference<? extends ResolvedValueDeclaration> solveSymbol(String name, TypeSolver typeSolver) private SymbolReference<? extends ResolvedValueDeclaration> solveSymbolForFQN(String symbolName, String fqn) toString()Methods inherited from class AbstractTypeDeclaration
getAllMethods, isFunctionalInterface, isRecordTypeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface AssociableToAST
toAst, toAstMethods inherited from interface ResolvedDeclaration
asEnumConstant, asField, asMethod, asParameter, asTypePattern, hasName, isEnumConstant, isField, isMethod, isParameter, isTypePattern, isVariableMethods inherited from interface ResolvedInterfaceDeclaration
getAllInterfacesExtended, isInterfaceMethods inherited from interface ResolvedReferenceTypeDeclaration
asReferenceType, findTypeParameter, getAllAncestors, getAllAncestors, getAllMethods, getAllNonStaticFields, getAllStaticFields, getAncestors, getDeclaredAnnotation, getDeclaredFields, getField, getVisibleField, getVisibleFields, hasAnnotation, hasField, hasVisibleField, isFunctionalInterface, isInheritedAnnotation, isJavaLangEnum, isJavaLangObject, isJavaLangRecord, isReferenceTypeMethods inherited from interface ResolvedTypeDeclaration
asAnnotation, asClass, asEnum, asRecord, asType, asTypeParameter, getId, isAnnotation, isAnonymousClass, isClass, isEnum, isRecord, isType, isTypeParameterMethods inherited from interface ResolvedTypeParametrizable
isGeneric
-
Field Details
-
ctClass
private javassist.CtClass ctClass -
typeSolver
-
javassistTypeDeclarationAdapter
-
-
Constructor Details
-
JavassistInterfaceDeclaration
-
-
Method Details
-
toString
-
getInterfacesExtended
Description copied from interface:ResolvedInterfaceDeclarationReturn the list of interfaces extended directly by this one.- Specified by:
getInterfacesExtendedin interfaceResolvedInterfaceDeclaration
-
getPackageName
Description copied from interface:ResolvedTypeDeclarationThe package name of the type.- Specified by:
getPackageNamein interfaceResolvedTypeDeclaration
-
getClassName
Description copied from interface:ResolvedTypeDeclarationThe class(es) wrapping this type.- Specified by:
getClassNamein interfaceResolvedTypeDeclaration
-
getQualifiedName
Description copied from interface:ResolvedTypeDeclarationThe fully qualified name of the type declared.- Specified by:
getQualifiedNamein interfaceResolvedTypeDeclaration
-
solveMethodAsUsage
@Deprecated public Optional<MethodUsage> solveMethodAsUsage(String name, List<ResolvedType> argumentsTypes, Context invokationContext, List<ResolvedType> typeParameterValues) Deprecated.- Specified by:
solveMethodAsUsagein interfaceMethodUsageResolutionCapability
-
solveMethod
@Deprecated public SymbolReference<ResolvedMethodDeclaration> solveMethod(String name, List<ResolvedType> argumentsTypes, boolean staticOnly) Deprecated.- Specified by:
solveMethodin interfaceMethodResolutionCapability
-
getAllFields
Description copied from interface:ResolvedReferenceTypeDeclarationReturn a list of all fields, either declared in this declaration or inherited.- Specified by:
getAllFieldsin interfaceResolvedReferenceTypeDeclaration
-
isAssignableBy
Description copied from interface:ResolvedReferenceTypeDeclarationCan we assign instances of the given type to variables having the type defined by this declaration?- Specified by:
isAssignableByin interfaceResolvedReferenceTypeDeclaration
-
isAssignableBy
Description copied from interface:ResolvedReferenceTypeDeclarationCan we assign instances of the given type to variables having the type defined by this declaration?- Specified by:
isAssignableByin interfaceResolvedReferenceTypeDeclaration
-
canBeAssignedTo
Description copied from interface:ResolvedReferenceTypeDeclarationCan we assign instances of the type defined by this declaration to variables having the type defined by the given type?- Specified by:
canBeAssignedToin interfaceResolvedReferenceTypeDeclaration
-
getAncestors
Description copied from interface:ResolvedReferenceTypeDeclarationResolves the types of all direct ancestors (i.e., the directly extended class and the directly implemented interfaces) and returns the list of ancestors as a list of resolved reference types.If
acceptIncompleteListisfalse, then anUnsolvedSymbolExceptionis thrown if any ancestor cannot be resolved. Otherwise, a list of only the resolvable direct ancestors is returned.- Specified by:
getAncestorsin interfaceResolvedReferenceTypeDeclaration- Parameters:
acceptIncompleteList- When set tofalse, this method throws anUnsolvedSymbolExceptionif one or more ancestor could not be resolved. When set totrue, this method does not throw anUnsolvedSymbolException, but the list of returned ancestors may be incomplete in case one or more ancestor could not be resolved.- Returns:
- The list of resolved ancestors.
-
getDeclaredMethods
Description copied from interface:ResolvedReferenceTypeDeclarationReturn a list of all the methods declared in this type declaration.- Specified by:
getDeclaredMethodsin interfaceResolvedReferenceTypeDeclaration
-
hasDirectlyAnnotation
Description copied from interface:ResolvedReferenceTypeDeclarationHas the type at least one annotation declared having the specified qualified name?- Specified by:
hasDirectlyAnnotationin interfaceResolvedReferenceTypeDeclaration
-
getDeclaredAnnotations
Description copied from interface:ResolvedReferenceTypeDeclarationReturn a collection of all annotations declared in this type declaration.- Specified by:
getDeclaredAnnotationsin interfaceResolvedReferenceTypeDeclaration
-
getName
Description copied from interface:ResolvedDeclarationShould return the name or return null if the name is not available.- Specified by:
getNamein interfaceResolvedDeclaration
-
getTypeParameters
Description copied from interface:ResolvedTypeParametrizableThe list of type parameters defined on this element.- Specified by:
getTypeParametersin interfaceResolvedTypeParametrizable
-
accessSpecifier
Description copied from interface:HasAccessSpecifierThe access specifier of this element.- Specified by:
accessSpecifierin interfaceHasAccessSpecifier
-
asInterface
Description copied from interface:ResolvedTypeDeclarationReturn this as a InterfaceDeclaration or throw UnsupportedOperationException.- Specified by:
asInterfacein interfaceResolvedTypeDeclaration
-
solveSymbol
public SymbolReference<? extends ResolvedValueDeclaration> solveSymbol(String name, TypeSolver typeSolver) - Specified by:
solveSymbolin interfaceSymbolResolutionCapability- Parameters:
name- Field / symbol name.typeSolver- Symbol solver to resolve type usage.- Returns:
- Symbol reference of the resolved value.
-
solveSymbolForFQN
private SymbolReference<? extends ResolvedValueDeclaration> solveSymbolForFQN(String symbolName, String fqn) -
getInterfaceFQNs
-
containerType
Description copied from interface:ResolvedTypeDeclarationGet the ReferenceTypeDeclaration enclosing this declaration.- Specified by:
containerTypein interfaceResolvedTypeDeclaration
-
internalTypes
Description copied from interface:ResolvedTypeDeclarationGet the list of types defined inside the current type.- Specified by:
internalTypesin interfaceResolvedTypeDeclaration
-
getInternalType
Description copied from interface:ResolvedTypeDeclarationReturns a type declaration for the internal type based on name. (Does not include internal types inside internal types).- Specified by:
getInternalTypein interfaceResolvedTypeDeclaration
-
hasInternalType
Description copied from interface:ResolvedTypeDeclarationDoes this type contain an internal type with the given name? (Does not include internal types inside internal types).- Specified by:
hasInternalTypein interfaceResolvedTypeDeclaration
-
getConstructors
- Specified by:
getConstructorsin interfaceResolvedReferenceTypeDeclaration
-