public final class FieldInfo extends Object implements AnnotationTarget
Thread-Safety
This class is immutable and can be shared between threads without safe publication.AnnotationTarget.Kind| Modifier and Type | Method and Description |
|---|---|
List<AnnotationInstance> |
annotations()
Returns the list of annotation instances declared on this field.
|
ClassInfo |
asClass()
Casts and returns this target as a
ClassInfo if it is of kind CLASS |
FieldInfo |
asField()
Casts and returns this target as a
FieldInfo if it is of kind FIELD |
MethodInfo |
asMethod()
Casts and returns this target as a
MethodInfo if it is of kind METHOD |
MethodParameterInfo |
asMethodParameter()
Casts and returns this target as a
MethodParameterInfo if it is of kind METHOD_PARAMETER |
TypeTarget |
asType()
Casts and returns this target as a
TypeTarget if it is of kind TYPE |
static FieldInfo |
create(ClassInfo clazz,
String name,
Type type,
short flags)
Construct a new mock Field instance.
|
ClassInfo |
declaringClass()
Returns the class which declared the field
|
short |
flags()
Returns the access fields of this field.
|
AnnotationTarget.Kind |
kind()
Returns the kind of object this target represents.
|
String |
name()
Returns the local name of the field
|
String |
toString()
Returns a string representation describing this field.
|
Type |
type()
Returns the
Type declared on this field. |
public static FieldInfo create(ClassInfo clazz, String name, Type type, short flags)
clazz - the class declaring the fieldname - the name of the fieldtype - the Java field typeflags - the field attributespublic final String name()
public final ClassInfo declaringClass()
public final Type type()
Type declared on this field. This may be an array, a primitive, or a generic
type definition.public final AnnotationTarget.Kind kind()
AnnotationTargetkind in interface AnnotationTargetpublic List<AnnotationInstance> annotations()
public final short flags()
Modifier can be used on this value.public String toString()
public final ClassInfo asClass()
AnnotationTargetClassInfo if it is of kind CLASSasClass in interface AnnotationTargetpublic final FieldInfo asField()
AnnotationTargetFieldInfo if it is of kind FIELDasField in interface AnnotationTargetpublic final MethodInfo asMethod()
AnnotationTargetMethodInfo if it is of kind METHODasMethod in interface AnnotationTargetpublic final MethodParameterInfo asMethodParameter()
AnnotationTargetMethodParameterInfo if it is of kind METHOD_PARAMETERasMethodParameter in interface AnnotationTargetpublic final TypeTarget asType()
AnnotationTargetTypeTarget if it is of kind TYPEasType in interface AnnotationTargetCopyright © 2025 JBoss by Red Hat. All rights reserved.