Example usage for Java java.lang.reflect Field fields, constructors, methods, implement or subclass
The text is from its open source code.
String | name |
boolean | equals(Object obj) Compares this Field against the specified object. |
Object | get(Object obj) Returns the value of the field represented by this Field , on the specified object. |
AnnotatedType | getAnnotatedType() Returns an AnnotatedType object that represents the use of a type to specify the declared type of the field represented by this Field. |
T | getAnnotation(Class |
Annotation[] | getAnnotations() |
T[] | getAnnotationsByType(Class |
boolean | getBoolean(Object obj) Gets the value of a static or instance boolean field. |
byte | getByte(Object obj) Gets the value of a static or instance byte field. |
char | getChar(Object obj) Gets the value of a static or instance field of type char or of another primitive type convertible to type char via a widening conversion. |
Class> | getClass() Returns the runtime class of this Object . |
T | getDeclaredAnnotation(Class |
Annotation[] | getDeclaredAnnotations() |
Class> | getDeclaringClass() Returns the Class object representing the class or interface that declares the field represented by this Field object. |
double | getDouble(Object obj) Gets the value of a static or instance field of type double or of another primitive type convertible to type double via a widening conversion. |
float | getFloat(Object obj) Gets the value of a static or instance field of type float or of another primitive type convertible to type float via a widening conversion. |
Type | getGenericType() Returns a Type object that represents the declared type for the field represented by this Field object. |
int | getInt(Object obj) Gets the value of a static or instance field of type int or of another primitive type convertible to type int via a widening conversion. |
long | getLong(Object obj) Gets the value of a static or instance field of type long or of another primitive type convertible to type long via a widening conversion. |
int | getModifiers() Returns the Java language modifiers for the field represented by this Field object, as an integer. |
String | getName() Returns the name of the field represented by this Field object. |
short | getShort(Object obj) Gets the value of a static or instance field of type short or of another primitive type convertible to type short via a widening conversion. |
Class> | getType() Returns a Class object that identifies the declared type for the field represented by this Field object. |
int | hashCode() Returns a hashcode for this Field . |
boolean | isAccessible() Get the value of the accessible flag for this reflected object. |
boolean | isAnnotationPresent(Class extends Annotation> annotationClass) |
boolean | isEnumConstant() Returns true if this field represents an element of an enumerated type; returns false otherwise. |
boolean | isSynthetic() Returns true if this field is a synthetic field; returns false otherwise. |
void | set(Object obj, Object value) Sets the field represented by this Field object on the specified object argument to the specified new value. |
void | setAccessible(boolean flag) |
void | setBoolean(Object obj, boolean z) Sets the value of a field as a boolean on the specified object. |
void | setByte(Object obj, byte b) Sets the value of a field as a byte on the specified object. |
void | setChar(Object obj, char c) Sets the value of a field as a char on the specified object. |
void | setDouble(Object obj, double d) Sets the value of a field as a double on the specified object. |
void | setFloat(Object obj, float f) Sets the value of a field as a float on the specified object. |
void | setInt(Object obj, int i) Sets the value of a field as an int on the specified object. |
void | setLong(Object obj, long l) Sets the value of a field as a long on the specified object. |
void | setShort(Object obj, short s) Sets the value of a field as a short on the specified object. |
String | toGenericString() Returns a string describing this Field , including its generic type. |
String | toString() Returns a string describing this Field . |