ReceiverAccessor.GetterOnlyReflection, Accessor.SetterOnlyReflectionpublic static class Accessor.GetterSetterReflection<BeanT,ValueT> extends Accessor<BeanT,ValueT>
Accessor that uses Java reflection to access a getter and a setter.Accessor.FieldReflection<BeanT,ValueT>, Accessor.GetterOnlyReflection<BeanT,ValueT>, Accessor.GetterSetterReflection<BeanT,ValueT>, Accessor.ReadOnlyFieldReflection<BeanT,ValueT>, Accessor.SetterOnlyReflection<BeanT,ValueT>| Modifier and Type | Field | Description |
|---|---|---|
java.lang.reflect.Method |
getter |
|
java.lang.reflect.Method |
setter |
JAXB_ELEMENT_VALUE, valueType| Constructor | Description |
|---|---|
GetterSetterReflection(java.lang.reflect.Method getter,
java.lang.reflect.Method setter) |
| Modifier and Type | Method | Description |
|---|---|---|
ValueT |
get(BeanT bean) |
Gets the value of the property of the given bean object.
|
Accessor<BeanT,ValueT> |
optimize(JAXBContextImpl context) |
Returns the optimized version of the same accessor.
|
void |
set(BeanT bean,
ValueT value) |
Sets the value of the property of the given bean object.
|
adapt, adapt, getErrorInstance, getUnadapted, getValueType, isAbstractable, isAdapted, isValueTypeAbstractable, receive, setUnadaptedpublic final java.lang.reflect.Method getter
public final java.lang.reflect.Method setter
public GetterSetterReflection(java.lang.reflect.Method getter,
java.lang.reflect.Method setter)
public ValueT get(BeanT bean) throws AccessorException
Accessorget in class Accessor<BeanT,ValueT>bean - must not be null.AccessorException - if failed to set a value. For example, the getter method
may throw an exception.public void set(BeanT bean, ValueT value) throws AccessorException
Accessorset in class Accessor<BeanT,ValueT>bean - must not be null.value - the value to be set. Setting value to null means resetting
to the VM default value (even for primitive properties.)AccessorException - if failed to set a value. For example, the setter method
may throw an exception.public Accessor<BeanT,ValueT> optimize(JAXBContextImpl context)
Accessoroptimize in class Accessor<BeanT,ValueT>context - The JAXBContextImpl that owns the whole thing.
(See RuntimeModelBuilder.context.)this.Copyright © 2018 Oracle Corporation. All rights reserved.