public interface DeclarationInfo extends AnnotationTarget
| Modifier and Type | Interface and Description |
|---|---|
static class |
DeclarationInfo.Kind |
| Modifier and Type | Method and Description |
|---|---|
default ClassInfo |
asClass()
Returns this declaration as a class.
|
default DeclarationInfo |
asDeclaration()
Returns this annotation target as a declaration.
|
default FieldInfo |
asField()
Returns this declaration as a field.
|
default MethodInfo |
asMethod()
Returns this declaration as a method.
|
default PackageInfo |
asPackage()
Returns this declaration as a package.
|
default ParameterInfo |
asParameter()
Returns this declaration as a method parameter.
|
default RecordComponentInfo |
asRecordComponent()
Returns this declaration as a record component.
|
default Type |
asType()
Returns this annotation target as a type.
|
default boolean |
isClass()
Returns whether this declaration is a class.
|
default boolean |
isDeclaration()
Returns whether this annotation target is a declaration.
|
default boolean |
isField()
Returns whether this declaration is a field.
|
default boolean |
isMethod()
Returns whether this declaration is a method.
|
default boolean |
isPackage()
Returns whether this declaration is a package.
|
default boolean |
isParameter()
Returns whether this declaration is a method parameter.
|
default boolean |
isRecordComponent()
Returns whether this declaration is a record component.
|
default boolean |
isType()
Returns whether this annotation target is a type.
|
DeclarationInfo.Kind |
kind()
Returns the kind of this declaration.
|
annotation, annotations, annotations, hasAnnotation, hasAnnotation, repeatableAnnotationdefault boolean isDeclaration()
AnnotationTargetisDeclaration in interface AnnotationTargettrue if this is a declaration, false otherwisedefault boolean isType()
AnnotationTargetisType in interface AnnotationTargettrue if this is a type, false otherwisedefault DeclarationInfo asDeclaration()
AnnotationTargetasDeclaration in interface AnnotationTargetnulldefault Type asType()
AnnotationTargetasType in interface AnnotationTargetnullDeclarationInfo.Kind kind()
default boolean isPackage()
true if this is a package, false otherwisedefault boolean isClass()
true if this is a class, false otherwisedefault boolean isMethod()
true if this is a method, false otherwisedefault boolean isParameter()
true if this is a parameter, false otherwisedefault boolean isField()
true if this is a field, false otherwisedefault boolean isRecordComponent()
true if this is a record component, false otherwisedefault PackageInfo asPackage()
nulljava.lang.IllegalStateException - if isPackage() returns falsedefault ClassInfo asClass()
nulljava.lang.IllegalStateException - if isClass() returns falsedefault MethodInfo asMethod()
nulljava.lang.IllegalStateException - if isMethod() returns falsedefault ParameterInfo asParameter()
nulljava.lang.IllegalStateException - if isParameter() returns falsedefault FieldInfo asField()
nulljava.lang.IllegalStateException - if isField() returns falsedefault RecordComponentInfo asRecordComponent()
nulljava.lang.IllegalStateException - if isRecordComponent() returns false