Logo Search packages:      
Sourcecode: jamvm version File versions

Object java::lang::reflect::Field::get ( Object  o  )  throws IllegalAccessException [inline]

Get the value of this Field. If it is primitive, it will be wrapped in the appropriate wrapper type (boolean = java.lang.Boolean).

If the field is static, o will be ignored. Otherwise, if o is null, you get a NullPointerException, and if it is incompatible with the declaring class of the field, you get an IllegalArgumentException.

Next, if this Field enforces access control, your runtime context is evaluated, and you may have an IllegalAccessException if you could not access this field in similar compiled code. If the field is static, and its class is uninitialized, you trigger class initialization, which may end in a ExceptionInInitializerError.

Finally, the field is accessed, and primitives are wrapped (but not necessarily in new objects). This method accesses the field of the declaring class, even if the instance passed in belongs to a subclass which declares another field to hide this one.

Parameters:
o the object to get the value of this Field from
Returns:
the value of the Field
Exceptions:
IllegalAccessException if you could not normally access this field (i.e. it is not public)
IllegalArgumentException if o is not an instance of the class or interface declaring this field
NullPointerException if o is null and this field requires an instance
ExceptionInInitializerError if accessing a static field triggered class initialization, which then failed
See also:
getBoolean(Object)

getByte(Object)

getChar(Object)

getShort(Object)

getInt(Object)

getLong(Object)

getFloat(Object)

getDouble(Object)

Definition at line 233 of file Field.java.

                                                            {
    return getField(o, declaringClass, type, slot);
  }


Generated by  Doxygen 1.6.0   Back to index