Interface ResolvedClassDeclaration
-
- All Superinterfaces:
AssociableToAST
,HasAccessSpecifier
,ResolvedDeclaration
,ResolvedReferenceTypeDeclaration
,ResolvedTypeDeclaration
,ResolvedTypeParametrizable
public interface ResolvedClassDeclaration extends ResolvedReferenceTypeDeclaration, ResolvedTypeParametrizable, HasAccessSpecifier
Declaration of a Class (not an interface or an enum). Note that it can be associated to a Node AST because anonymous class declarations return an incompatible node type, compared to classic class declarations.- Author:
- Federico Tomassetti
-
-
Field Summary
-
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
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description List<ResolvedReferenceType>
getAllInterfaces()
Return all the interfaces implemented by this class, either directly or indirectly, including the interfaces extended by interfaces it implements.List<ResolvedReferenceType>
getAllSuperClasses()
Get all superclasses, with all the type typeParametersValues expressed as functions of the type typeParametersValues of this declaration.List<ResolvedConstructorDeclaration>
getConstructors()
List of constructors available for the class.List<ResolvedReferenceType>
getInterfaces()
Return all the interfaces implemented directly by this class.Optional<ResolvedReferenceType>
getSuperClass()
This is a ReferenceTypeUsage because it could contain type typeParametersValues.default boolean
isClass()
This method should always return true.-
Methods inherited from interface com.github.javaparser.resolution.declarations.AssociableToAST
toAst, toAst
-
Methods inherited from interface com.github.javaparser.resolution.declarations.HasAccessSpecifier
accessSpecifier
-
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedDeclaration
asEnumConstant, asField, asMethod, asParameter, asTypePattern, getName, hasName, isEnumConstant, isField, isMethod, isParameter, isTypePattern, isVariable
-
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
asReferenceType, canBeAssignedTo, findTypeParameter, getAllAncestors, getAllAncestors, getAllFields, getAllMethods, getAllNonStaticFields, getAllStaticFields, getAncestors, getAncestors, getDeclaredAnnotation, getDeclaredAnnotations, getDeclaredFields, getDeclaredMethods, getField, getVisibleField, getVisibleFields, hasAnnotation, hasDirectlyAnnotation, hasField, hasVisibleField, isAssignableBy, isAssignableBy, isFunctionalInterface, isInheritedAnnotation, isJavaLangEnum, isJavaLangObject, isJavaLangRecord, isReferenceType
-
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration
asAnnotation, asClass, asEnum, asInterface, asRecord, asType, asTypeParameter, containerType, getClassName, getId, getInternalType, getPackageName, getQualifiedName, hasInternalType, internalTypes, isAnnotation, isAnonymousClass, isEnum, isInterface, isRecord, isType, isTypeParameter
-
Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedTypeParametrizable
getTypeParameters, isGeneric
-
-
-
-
Method Detail
-
isClass
default boolean isClass()
This method should always return true.- Specified by:
isClass
in interfaceResolvedTypeDeclaration
-
getSuperClass
Optional<ResolvedReferenceType> getSuperClass()
This is a ReferenceTypeUsage because it could contain type typeParametersValues. For example:class A extends B<Integer, String>
.Note that only the Object class should not have a superclass and therefore return empty.
-
getInterfaces
List<ResolvedReferenceType> getInterfaces()
Return all the interfaces implemented directly by this class. It does not include the interfaces implemented by superclasses or extended by the interfaces implemented.
-
getAllSuperClasses
List<ResolvedReferenceType> getAllSuperClasses()
Get all superclasses, with all the type typeParametersValues expressed as functions of the type typeParametersValues of this declaration.
-
getAllInterfaces
List<ResolvedReferenceType> getAllInterfaces()
Return all the interfaces implemented by this class, either directly or indirectly, including the interfaces extended by interfaces it implements.Get all interfaces, with all the type typeParametersValues expressed as functions of the type typeParametersValues of this declaration.
-
getConstructors
List<ResolvedConstructorDeclaration> getConstructors()
List of constructors available for the class. This list should also include the default constructor.- Specified by:
getConstructors
in interfaceResolvedReferenceTypeDeclaration
-
-