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, repeatableAnnotation
default boolean isDeclaration()
AnnotationTarget
isDeclaration
in interface AnnotationTarget
true
if this is a declaration, false
otherwisedefault boolean isType()
AnnotationTarget
isType
in interface AnnotationTarget
true
if this is a type, false
otherwisedefault DeclarationInfo asDeclaration()
AnnotationTarget
asDeclaration
in interface AnnotationTarget
null
default Type asType()
AnnotationTarget
asType
in interface AnnotationTarget
null
DeclarationInfo.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()
null
java.lang.IllegalStateException
- if isPackage()
returns false
default ClassInfo asClass()
null
java.lang.IllegalStateException
- if isClass()
returns false
default MethodInfo asMethod()
null
java.lang.IllegalStateException
- if isMethod()
returns false
default ParameterInfo asParameter()
null
java.lang.IllegalStateException
- if isParameter()
returns false
default FieldInfo asField()
null
java.lang.IllegalStateException
- if isField()
returns false
default RecordComponentInfo asRecordComponent()
null
java.lang.IllegalStateException
- if isRecordComponent()
returns false