public static interface FieldValueResolver.FieldWrapper
extends java.lang.reflect.Member
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
get(java.lang.Object obj)
Returns the value of the field represented by this
Field , on
the specified object. |
java.lang.Object get(java.lang.Object obj) throws java.lang.IllegalAccessException
Field
, on
the specified object. The value is automatically wrapped in an
object if it has a primitive type.
The underlying field's value is obtained as follows:
If the underlying field is a static field, the obj
argument is ignored; it may be
null.
Otherwise, the underlying field is an instance field. If the specified obj
argument
is null, the method throws a NullPointerException
. If the specified object is not an
instance of the class or interface declaring the underlying field, the method throws an
IllegalArgumentException
.
If this Field
object enforces Java language access control, and the underlying field
is inaccessible, the method throws an IllegalAccessException
. If the underlying field
is static, the class that declared the field is initialized if it has not already been
initialized.
Otherwise, the value is retrieved from the underlying instance or static field. If the field has a primitive type, the value is wrapped in an object before being returned, otherwise it is returned as is.
If the field is hidden in the type of obj
, the field's value is obtained according to
the preceding rules.
obj
- object from which the represented field's value is
to be extractedobj
; primitive values are
wrapped in an appropriate
object before being returnedjava.lang.IllegalAccessException
- if the underlying field
is inaccessible.Copyright © 2010 - 2020 Adobe. All Rights Reserved