com.sun.xml.bind.v2.runtime.reflect
public abstract class Accessor<BeanT,ValueT> extends Object implements Receiver
See Also: FieldReflection TransducedAccessor
Nested Class Summary | |
---|---|
static class | Accessor.FieldReflection<BeanT,ValueT>
Accessor that uses Java reflection to access a field. |
static class | Accessor.GetterOnlyReflection<BeanT,ValueT>
A version of GetterSetterReflection thaat doesn't have any setter.
|
static class | Accessor.GetterSetterReflection<BeanT,ValueT>
Accessor that uses Java reflection to access a getter and a setter. |
static class | Accessor.ReadOnlyFieldReflection<BeanT,ValueT>
Read-only access to Field. |
static class | Accessor.SetterOnlyReflection<BeanT,ValueT>
A version of GetterSetterReflection thaat doesn't have any getter.
|
Field Summary | |
---|---|
static Accessor<JAXBElement,Object> | JAXB_ELEMENT_VALUE
Accessor for JAXBElement#getValue(). |
Class<ValueT> | valueType |
Constructor Summary | |
---|---|
protected | Accessor(Class<ValueT> valueType) |
Method Summary | |
---|---|
<T> Accessor<BeanT,T> | adapt(Class<T> targetType, Class<? extends XmlAdapter<T,ValueT>> adapter) |
<T> Accessor<BeanT,T> | adapt(Adapter<Type,Class> adapter) |
abstract ValueT | get(BeanT bean)
Gets the value of the property of the given bean object.
|
static <A,B> Accessor<A,B> | getErrorInstance()
Gets the special Accessor used to recover from errors. |
Object | getUnadapted(BeanT bean)
Sets the value without adapting the value.
|
Class<ValueT> | getValueType() |
boolean | isAdapted()
Returns true if this accessor wraps an adapter.
|
boolean | isValueTypeAbstractable() |
Accessor<BeanT,ValueT> | optimize(JAXBContextImpl context)
Returns the optimized version of the same accessor.
|
void | receive(UnmarshallingContext.State state, Object o) |
abstract void | set(BeanT bean, ValueT value)
Sets the value of the property of the given bean object.
|
void | setUnadapted(BeanT bean, Object value)
Sets the value without adapting the value.
|
Parameters: bean must not be null.
Throws: AccessorException if failed to set a value. For example, the getter method may throw an exception.
Since: 2.0 EA1
Parameters: context The JAXBContextImpl that owns the whole thing. (See context.)
Returns: At least the implementation can return this.
Parameters: 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.)
Throws: AccessorException if failed to set a value. For example, the setter method may throw an exception.
Since: 2.0 EA1