This class is immutable; therefore, it can be safely shared across threads.
| Access | Constructor and Description |
|---|---|
| public | FieldAttributes(Field
the field to pull attributes from f)Constructs a Field Attributes object from the |
| Modifier and Type | Method and Description |
|---|---|
| public <T extends Annotation> T | Returns: the annotation instance if it is bound to the field; otherwisenullthe class of the annotation that will be retrieved annotation)Returns the |
| public Collection | Returns: an array of all the annotations set on the fieldReturns the annotations that are present on this field. |
| public Class | Returns: the specific class object that was declared for the fieldReturns the |
| public Type | Returns: the specific type declared for this fieldReturns the declared generic type of the field. |
| public Class | Returns: the declaring class that contains this fieldGets the declaring Class that contains this field |
| public String | |
| public boolean | |
| public String |
| field | back to summary |
|---|---|
| private final Field field | |
| FieldAttributes | back to summary |
|---|---|
| public FieldAttributes(Field f) Constructs a Field Attributes object from the
| |
| getAnnotation | back to summary |
|---|---|
| public <T extends Annotation> T getAnnotation(Class<T> annotation) Returns the
| |
| getAnnotations | back to summary |
|---|---|
| public Collection Returns the annotations that are present on this field.
| |
| getDeclaredClass | back to summary |
|---|---|
| public Class Returns the For example, assume the following class definition:
public class Foo {
private String bar;
private List<String> red;
}
This method would return
| |
| getDeclaredType | back to summary |
|---|---|
| public Type getDeclaredType() Returns the declared generic type of the field. For example, assume the following class definition:
public class Foo {
private String bar;
private List<String> red;
}
Type listParameterizedType = new TypeToken<List<String>>() {}.getType();
This method would return
| |
| getDeclaringClass | back to summary |
|---|---|
| public Class Gets the declaring Class that contains this field
| |
| getName | back to summary |
|---|---|
| public String getName() Gets the name of the field
| |
| hasModifier | back to summary |
|---|---|
| public boolean hasModifier(int modifier) Returns This method is meant to be called as: boolean hasPublicModifier = fieldAttribute.hasModifier(java.lang.reflect.Modifier.PUBLIC);
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |