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()
AnnotationTarget
kind
in interface AnnotationTarget
public List<AnnotationInstance> annotations()
public final short flags()
Modifier
can be used on this value.public String toString()
public final ClassInfo asClass()
AnnotationTarget
ClassInfo
if it is of kind CLASS
asClass
in interface AnnotationTarget
public final FieldInfo asField()
AnnotationTarget
FieldInfo
if it is of kind FIELD
asField
in interface AnnotationTarget
public final MethodInfo asMethod()
AnnotationTarget
MethodInfo
if it is of kind METHOD
asMethod
in interface AnnotationTarget
public final MethodParameterInfo asMethodParameter()
AnnotationTarget
MethodParameterInfo
if it is of kind METHOD_PARAMETER
asMethodParameter
in interface AnnotationTarget
public final TypeTarget asType()
AnnotationTarget
TypeTarget
if it is of kind TYPE
asType
in interface AnnotationTarget
Copyright © 2018 JBoss by Red Hat. All rights reserved.