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.CtClass
private JavassistTypeDeclarationAdapter
private TypeSolver
Fields inherited from interface com.github.javaparser.resolution.declarations.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.boolean
Can 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.boolean
hasDirectlyAnnotation
(String canonicalName) Has the type at least one annotation declared having the specified qualified name?boolean
hasInternalType
(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.boolean
Can we assign instances of the given type to variables having the type defined by this declaration?boolean
isAssignableBy
(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 com.github.javaparser.symbolsolver.logic.AbstractTypeDeclaration
getAllMethods, isFunctionalInterface, isRecordType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.github.javaparser.resolution.declarations.AssociableToAST
toAst, toAst
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedDeclaration
asEnumConstant, asField, asMethod, asParameter, asTypePattern, hasName, isEnumConstant, isField, isMethod, isParameter, isTypePattern, isVariable
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedInterfaceDeclaration
getAllInterfacesExtended, isInterface
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
asReferenceType, findTypeParameter, getAllAncestors, getAllAncestors, getAllMethods, getAllNonStaticFields, getAllStaticFields, getAncestors, getDeclaredAnnotation, getDeclaredFields, getField, getVisibleField, getVisibleFields, hasAnnotation, hasField, hasVisibleField, isFunctionalInterface, isInheritedAnnotation, isJavaLangEnum, isJavaLangObject, isJavaLangRecord, isReferenceType
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration
asAnnotation, asClass, asEnum, asRecord, asType, asTypeParameter, getId, isAnnotation, isAnonymousClass, isClass, isEnum, isRecord, isType, isTypeParameter
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedTypeParametrizable
isGeneric
-
Field Details
-
ctClass
private javassist.CtClass ctClass -
typeSolver
-
javassistTypeDeclarationAdapter
-
-
Constructor Details
-
JavassistInterfaceDeclaration
-
-
Method Details
-
toString
-
getInterfacesExtended
Description copied from interface:ResolvedInterfaceDeclaration
Return the list of interfaces extended directly by this one.- Specified by:
getInterfacesExtended
in interfaceResolvedInterfaceDeclaration
-
getPackageName
Description copied from interface:ResolvedTypeDeclaration
The package name of the type.- Specified by:
getPackageName
in interfaceResolvedTypeDeclaration
-
getClassName
Description copied from interface:ResolvedTypeDeclaration
The class(es) wrapping this type.- Specified by:
getClassName
in interfaceResolvedTypeDeclaration
-
getQualifiedName
Description copied from interface:ResolvedTypeDeclaration
The fully qualified name of the type declared.- Specified by:
getQualifiedName
in interfaceResolvedTypeDeclaration
-
solveMethodAsUsage
@Deprecated public Optional<MethodUsage> solveMethodAsUsage(String name, List<ResolvedType> argumentsTypes, Context invokationContext, List<ResolvedType> typeParameterValues) Deprecated.- Specified by:
solveMethodAsUsage
in interfaceMethodUsageResolutionCapability
-
solveMethod
@Deprecated public SymbolReference<ResolvedMethodDeclaration> solveMethod(String name, List<ResolvedType> argumentsTypes, boolean staticOnly) Deprecated.- Specified by:
solveMethod
in interfaceMethodResolutionCapability
-
getAllFields
Description copied from interface:ResolvedReferenceTypeDeclaration
Return a list of all fields, either declared in this declaration or inherited.- Specified by:
getAllFields
in interfaceResolvedReferenceTypeDeclaration
-
isAssignableBy
Description copied from interface:ResolvedReferenceTypeDeclaration
Can we assign instances of the given type to variables having the type defined by this declaration?- Specified by:
isAssignableBy
in interfaceResolvedReferenceTypeDeclaration
-
isAssignableBy
Description copied from interface:ResolvedReferenceTypeDeclaration
Can we assign instances of the given type to variables having the type defined by this declaration?- Specified by:
isAssignableBy
in interfaceResolvedReferenceTypeDeclaration
-
canBeAssignedTo
Description copied from interface:ResolvedReferenceTypeDeclaration
Can we assign instances of the type defined by this declaration to variables having the type defined by the given type?- Specified by:
canBeAssignedTo
in interfaceResolvedReferenceTypeDeclaration
-
getAncestors
Description copied from interface:ResolvedReferenceTypeDeclaration
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.If
acceptIncompleteList
isfalse
, then anUnsolvedSymbolException
is thrown if any ancestor cannot be resolved. Otherwise, a list of only the resolvable direct ancestors is returned.- Specified by:
getAncestors
in interfaceResolvedReferenceTypeDeclaration
- Parameters:
acceptIncompleteList
- When set tofalse
, this method throws anUnsolvedSymbolException
if 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:ResolvedReferenceTypeDeclaration
Return a list of all the methods declared in this type declaration.- Specified by:
getDeclaredMethods
in interfaceResolvedReferenceTypeDeclaration
-
hasDirectlyAnnotation
Description copied from interface:ResolvedReferenceTypeDeclaration
Has the type at least one annotation declared having the specified qualified name?- Specified by:
hasDirectlyAnnotation
in interfaceResolvedReferenceTypeDeclaration
-
getDeclaredAnnotations
Description copied from interface:ResolvedReferenceTypeDeclaration
Return a collection of all annotations declared in this type declaration.- Specified by:
getDeclaredAnnotations
in interfaceResolvedReferenceTypeDeclaration
-
getName
Description copied from interface:ResolvedDeclaration
Should return the name or return null if the name is not available.- Specified by:
getName
in interfaceResolvedDeclaration
-
getTypeParameters
Description copied from interface:ResolvedTypeParametrizable
The list of type parameters defined on this element.- Specified by:
getTypeParameters
in interfaceResolvedTypeParametrizable
-
accessSpecifier
Description copied from interface:HasAccessSpecifier
The access specifier of this element.- Specified by:
accessSpecifier
in interfaceHasAccessSpecifier
-
asInterface
Description copied from interface:ResolvedTypeDeclaration
Return this as a InterfaceDeclaration or throw UnsupportedOperationException.- Specified by:
asInterface
in interfaceResolvedTypeDeclaration
-
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.
-
solveSymbolForFQN
private SymbolReference<? extends ResolvedValueDeclaration> solveSymbolForFQN(String symbolName, String fqn) -
getInterfaceFQNs
-
containerType
Description copied from interface:ResolvedTypeDeclaration
Get the ReferenceTypeDeclaration enclosing this declaration.- Specified by:
containerType
in interfaceResolvedTypeDeclaration
-
internalTypes
Description copied from interface:ResolvedTypeDeclaration
Get the list of types defined inside the current type.- Specified by:
internalTypes
in interfaceResolvedTypeDeclaration
-
getInternalType
Description copied from interface:ResolvedTypeDeclaration
Returns a type declaration for the internal type based on name. (Does not include internal types inside internal types).- Specified by:
getInternalType
in interfaceResolvedTypeDeclaration
-
hasInternalType
Description copied from interface:ResolvedTypeDeclaration
Does this type contain an internal type with the given name? (Does not include internal types inside internal types).- Specified by:
hasInternalType
in interfaceResolvedTypeDeclaration
-
getConstructors
- Specified by:
getConstructors
in interfaceResolvedReferenceTypeDeclaration
-