java.lang.Object | |||
java.lang.reflect.AccessibleObject | AnnotatedElement | ||
java.lang.reflect.Field | Member |
This class must be implemented by the VM vendor. This class models a field. Information about the field can be accessed, and the field's value can be accessed dynamically.
boolean | equals(Object object) | |||||
Compares the specified object to this Field and answer if they are equal. | ||||||
Object | get(Object object) | |||||
Return the value of the field in the specified object. | ||||||
boolean | getBoolean(Object object) | |||||
Return the value of the field in the specified object as a boolean. | ||||||
byte | getByte(Object object) | |||||
Return the value of the field in the specified object as a byte. | ||||||
char | getChar(Object object) | |||||
Return the value of the field in the specified object as a char. | ||||||
Annotation[] | getDeclaredAnnotations() | |||||
Gets all Annotations that are explicitly declared by this element (not inherited). | ||||||
Class<?> | getDeclaringClass() | |||||
Return the Class associated with the class that defined this field. | ||||||
double | getDouble(Object object) | |||||
Return the value of the field in the specified object as a double. | ||||||
float | getFloat(Object object) | |||||
Return the value of the field in the specified object as a float. | ||||||
Type | getGenericType() | |||||
Gets the declared type of this field. |
||||||
int | getInt(Object object) | |||||
Return the value of the field in the specified object as an int. | ||||||
long | getLong(Object object) | |||||
Return the value of the field in the specified object as a long. | ||||||
int | getModifiers() | |||||
Return the modifiers for the modeled field. | ||||||
String | getName() | |||||
Return the name of the modeled field. | ||||||
short | getShort(Object object) | |||||
Return the value of the field in the specified object as a short. | ||||||
Class<?> | getType() | |||||
Return the Class associated with the type of this field. | ||||||
int | hashCode() | |||||
Returns an integer hash code for the receiver. | ||||||
boolean | isEnumConstant() | |||||
Indicates whether or not this field is an enumeration constant. |
||||||
boolean | isSynthetic() | |||||
Indicates whether or not this field is synthetic. |
||||||
void | set(Object object, Object value) | |||||
Set the value of the field in the specified object to the boolean value. | ||||||
void | setBoolean(Object object, boolean value) | |||||
Set the value of the field in the specified object to the boolean value. | ||||||
void | setByte(Object object, byte value) | |||||
Set the value of the field in the specified object to the byte value. | ||||||
void | setChar(Object object, char value) | |||||
Set the value of the field in the specified object to the char value. | ||||||
void | setDouble(Object object, double value) | |||||
Set the value of the field in the specified object to the double value. | ||||||
void | setFloat(Object object, float value) | |||||
Set the value of the field in the specified object to the float value. | ||||||
void | setInt(Object object, int value) | |||||
Set the value of the field in the specified object to the int value. | ||||||
void | setLong(Object object, long value) | |||||
Set the value of the field in the specified object to the long value. | ||||||
void | setShort(Object object, short value) | |||||
Set the value of the field in the specified object to the short value. | ||||||
String | toGenericString() | |||||
Returns the String representation of the field's declaration, including the type parameters. |
||||||
String | toString() | |||||
Returns a string containing a concise, human-readable description of the receiver. |
object | the object to compare |
---|
object.fieldName
If the modeled field is static, the object argument is ignored. Otherwise, if the object is null, a NullPointerException is thrown. If the object is not an instance of the declaring class of the method, an IllegalArgumentException is thrown.
If this Field object is enforcing access control (see AccessibleObject) and the modeled field is not accessible from the current context, an IllegalAccessException is thrown.
The value of the field is returned. If the type of this field is a base type, the field value is automatically wrapped.
object | the object to access |
---|
NullPointerException | if the object is null and the field is non-static |
---|---|
IllegalArgumentException | if the object is not compatible with the declaring class |
IllegalAccessException | if modeled field is not accessible |
object.fieldName
If the modeled field is static, the object argument is ignored. Otherwise, if the object is null, a NullPointerException is thrown. If the object is not an instance of the declaring class of the method, an IllegalArgumentException is thrown.
If this Field object is enforcing access control (see AccessibleObject) and the modeled field is not accessible from the current context, an IllegalAccessException is thrown.
object | the object to access |
---|
NullPointerException | if the object is null and the field is non-static |
---|---|
IllegalArgumentException | if the object is not compatible with the declaring class |
IllegalAccessException | if modeled field is not accessible |
object.fieldName
If the modeled field is static, the object argument is ignored. Otherwise, if the object is null, a NullPointerException is thrown. If the object is not an instance of the declaring class of the method, an IllegalArgumentException is thrown.
If this Field object is enforcing access control (see AccessibleObject) and the modeled field is not accessible from the current context, an IllegalAccessException is thrown.
object | the object to access |
---|
NullPointerException | if the object is null and the field is non-static |
---|---|
IllegalArgumentException | if the object is not compatible with the declaring class |
IllegalAccessException | if modeled field is not accessible |
object.fieldName
If the modeled field is static, the object argument is ignored. Otherwise, if the object is null, a NullPointerException is thrown. If the object is not an instance of the declaring class of the method, an IllegalArgumentException is thrown.
If this Field object is enforcing access control (see AccessibleObject) and the modeled field is not accessible from the current context, an IllegalAccessException is thrown.
object | the object to access |
---|
NullPointerException | if the object is null and the field is non-static |
---|---|
IllegalArgumentException | if the object is not compatible with the declaring class |
IllegalAccessException | if modeled field is not accessible |
object.fieldName
If the modeled field is static, the object argument is ignored. Otherwise, if the object is null, a NullPointerException is thrown. If the object is not an instance of the declaring class of the method, an IllegalArgumentException is thrown.
If this Field object is enforcing access control (see AccessibleObject) and the modeled field is not accessible from the current context, an IllegalAccessException is thrown.
object | the object to access |
---|
NullPointerException | if the object is null and the field is non-static |
---|---|
IllegalArgumentException | if the object is not compatible with the declaring class |
IllegalAccessException | if modeled field is not accessible |
object.fieldName
If the modeled field is static, the object argument is ignored. Otherwise, if the object is null, a NullPointerException is thrown. If the object is not an instance of the declaring class of the method, an IllegalArgumentException is thrown.
If this Field object is enforcing access control (see AccessibleObject) and the modeled field is not accessible from the current context, an IllegalAccessException is thrown.
object | the object to access |
---|
NullPointerException | if the object is null and the field is non-static |
---|---|
IllegalArgumentException | if the object is not compatible with the declaring class |
IllegalAccessException | if modeled field is not accessible |
Gets the declared type of this field.
GenericSignatureFormatError | if the generic method signature is invalid. |
---|---|
TypeNotPresentException | if the component type points to a missing type. |
MalformedParameterizedTypeException | if the component type points to a type that can't be instantiated for some reason. |
object.fieldName
If the modeled field is static, the object argument is ignored. Otherwise, if the object is null, a NullPointerException is thrown. If the object is not an instance of the declaring class of the method, an IllegalArgumentException is thrown.
If this Field object is enforcing access control (see AccessibleObject) and the modeled field is not accessible from the current context, an IllegalAccessException is thrown.
object | the object to access |
---|
NullPointerException | if the object is null and the field is non-static |
---|---|
IllegalArgumentException | if the object is not compatible with the declaring class |
IllegalAccessException | if modeled field is not accessible |
object.fieldName
If the modeled field is static, the object argument is ignored. Otherwise, if the object is null, a NullPointerException is thrown. If the object is not an instance of the declaring class of the method, an IllegalArgumentException is thrown.
If this Field object is enforcing access control (see AccessibleObject) and the modeled field is not accessible from the current context, an IllegalAccessException is thrown.
object | the object to access |
---|
NullPointerException | if the object is null and the field is non-static |
---|---|
IllegalArgumentException | if the object is not compatible with the declaring class |
IllegalAccessException | if modeled field is not accessible |
object.fieldName
If the modeled field is static, the object argument is ignored. Otherwise, if the object is null, a NullPointerException is thrown. If the object is not an instance of the declaring class of the method, an IllegalArgumentException is thrown.
If this Field object is enforcing access control (see AccessibleObject) and the modeled field is not accessible from the current context, an IllegalAccessException is thrown.
object | the object to access |
---|
NullPointerException | if the object is null and the field is non-static |
---|---|
IllegalArgumentException | if the object is not compatible with the declaring class |
IllegalAccessException | if modeled field is not accessible |
The hash code for a Field is the hash code of the field's name.
Indicates whether or not this field is an enumeration constant.
true
if this field is an enumeration
constant, otherwise false
.Indicates whether or not this field is synthetic.
true
if this field is synthetic,
otherwise false
.object.fieldName = value
If the modeled field is static, the object argument is ignored. Otherwise, if the object is null, a NullPointerException is thrown. If the object is not an instance of the declaring class of the method, an IllegalArgumentException is thrown.
If this Field object is enforcing access control (see AccessibleObject) and the modeled field is not accessible from the current context, an IllegalAccessException is thrown.
If the field type is a base type, the value is automatically unwrapped. If the unwrap fails, an IllegalArgumentException is thrown. If the value cannot be converted to the field type via a widening conversion, an IllegalArgumentException is thrown.
object | the object to access |
---|---|
value | the new value |
NullPointerException | if the object is null and the field is non-static |
---|---|
IllegalArgumentException | if the object is not compatible with the declaring class |
IllegalAccessException | if modeled field is not accessible |
object.fieldName = value
If the modeled field is static, the object argument is ignored. Otherwise, if the object is null, a NullPointerException is thrown. If the object is not an instance of the declaring class of the method, an IllegalArgumentException is thrown.
If this Field object is enforcing access control (see AccessibleObject) and the modeled field is not accessible from the current context, an IllegalAccessException is thrown.
If the value cannot be converted to the field type via a widening conversion, an IllegalArgumentException is thrown.
object | the object to access |
---|---|
value | the new value |
NullPointerException | if the object is null and the field is non-static |
---|---|
IllegalArgumentException | if the object is not compatible with the declaring class |
IllegalAccessException | if modeled field is not accessible |
object.fieldName = value
If the modeled field is static, the object argument is ignored. Otherwise, if the object is null, a NullPointerException is thrown. If the object is not an instance of the declaring class of the method, an IllegalArgumentException is thrown.
If this Field object is enforcing access control (see AccessibleObject) and the modeled field is not accessible from the current context, an IllegalAccessException is thrown.
If the value cannot be converted to the field type via a widening conversion, an IllegalArgumentException is thrown.
object | the object to access |
---|---|
value | the new value |
NullPointerException | if the object is null and the field is non-static |
---|---|
IllegalArgumentException | if the object is not compatible with the declaring class |
IllegalAccessException | if modeled field is not accessible |
object.fieldName = value
If the modeled field is static, the object argument is ignored. Otherwise, if the object is null, a NullPointerException is thrown. If the object is not an instance of the declaring class of the method, an IllegalArgumentException is thrown.
If this Field object is enforcing access control (see AccessibleObject) and the modeled field is not accessible from the current context, an IllegalAccessException is thrown.
If the value cannot be converted to the field type via a widening conversion, an IllegalArgumentException is thrown.
object | the object to access |
---|---|
value | the new value |
NullPointerException | if the object is null and the field is non-static |
---|---|
IllegalArgumentException | if the object is not compatible with the declaring class |
IllegalAccessException | if modeled field is not accessible |
object.fieldName = value
If the modeled field is static, the object argument is ignored. Otherwise, if the object is null, a NullPointerException is thrown. If the object is not an instance of the declaring class of the method, an IllegalArgumentException is thrown.
If this Field object is enforcing access control (see AccessibleObject) and the modeled field is not accessible from the current context, an IllegalAccessException is thrown.
If the value cannot be converted to the field type via a widening conversion, an IllegalArgumentException is thrown.
object | the object to access |
---|---|
value | the new value |
NullPointerException | if the object is null and the field is non-static |
---|---|
IllegalArgumentException | if the object is not compatible with the declaring class |
IllegalAccessException | if modeled field is not accessible |
object.fieldName = value
If the modeled field is static, the object argument is ignored. Otherwise, if the object is null, a NullPointerException is thrown. If the object is not an instance of the declaring class of the method, an IllegalArgumentException is thrown.
If this Field object is enforcing access control (see AccessibleObject) and the modeled field is not accessible from the current context, an IllegalAccessException is thrown.
If the value cannot be converted to the field type via a widening conversion, an IllegalArgumentException is thrown.
object | the object to access |
---|---|
value | the new value |
NullPointerException | if the object is null and the field is non-static |
---|---|
IllegalArgumentException | if the object is not compatible with the declaring class |
IllegalAccessException | if modeled field is not accessible |
object.fieldName = value
If the modeled field is static, the object argument is ignored. Otherwise, if the object is null, a NullPointerException is thrown. If the object is not an instance of the declaring class of the method, an IllegalArgumentException is thrown.
If this Field object is enforcing access control (see AccessibleObject) and the modeled field is not accessible from the current context, an IllegalAccessException is thrown.
If the value cannot be converted to the field type via a widening conversion, an IllegalArgumentException is thrown.
object | the object to access |
---|---|
value | the new value |
NullPointerException | if the object is null and the field is non-static |
---|---|
IllegalArgumentException | if the object is not compatible with the declaring class |
IllegalAccessException | if modeled field is not accessible |
object.fieldName = value
If the modeled field is static, the object argument is ignored. Otherwise, if the object is null, a NullPointerException is thrown. If the object is not an instance of the declaring class of the method, an IllegalArgumentException is thrown.
If this Field object is enforcing access control (see AccessibleObject) and the modeled field is not accessible from the current context, an IllegalAccessException is thrown.
If the value cannot be converted to the field type via a widening conversion, an IllegalArgumentException is thrown.
object | the object to access |
---|---|
value | the new value |
NullPointerException | if the object is null and the field is non-static |
---|---|
IllegalArgumentException | if the object is not compatible with the declaring class |
IllegalAccessException | if modeled field is not accessible |
object.fieldName = value
If the modeled field is static, the object argument is ignored. Otherwise, if the object is null, a NullPointerException is thrown. If the object is not an instance of the declaring class of the method, an IllegalArgumentException is thrown.
If this Field object is enforcing access control (see AccessibleObject) and the modeled field is not accessible from the current context, an IllegalAccessException is thrown.
If the value cannot be converted to the field type via a widening conversion, an IllegalArgumentException is thrown.
object | the object to access |
---|---|
value | the new value |
NullPointerException | if the object is null and the field is non-static |
---|---|
IllegalArgumentException | if the object is not compatible with the declaring class |
IllegalAccessException | if modeled field is not accessible |
Returns the String representation of the field's declaration, including the type parameters.
The format of the string is:
For example:
public static java.io.InputStream java.lang.System.in
Copyright 2007 Google Inc. | Build 0.9_r1-98467 - 14 Aug 2008 18:48 |