com.sun.xml.bind.v2.runtime.reflect
Class AdaptedAccessor<BeanT,InMemValueT,OnWireValueT>

java.lang.Object
  extended by com.sun.xml.bind.v2.runtime.reflect.Accessor<BeanT,OnWireValueT>
      extended by com.sun.xml.bind.v2.runtime.reflect.AdaptedAccessor<BeanT,InMemValueT,OnWireValueT>
All Implemented Interfaces:
Receiver

final class AdaptedAccessor<BeanT,InMemValueT,OnWireValueT>
extends Accessor<BeanT,OnWireValueT>

Accessor that adapts the value by using Adapter.

See Also:
Accessor.adapt(java.lang.Class, java.lang.Class>)

Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.xml.bind.v2.runtime.reflect.Accessor
Accessor.FieldReflection<BeanT,ValueT>, Accessor.GetterOnlyReflection<BeanT,ValueT>, Accessor.GetterSetterReflection<BeanT,ValueT>, Accessor.ReadOnlyFieldReflection<BeanT,ValueT>, Accessor.SetterOnlyReflection<BeanT,ValueT>
 
Field Summary
 
Fields inherited from class com.sun.xml.bind.v2.runtime.reflect.Accessor
JAXB_ELEMENT_VALUE, valueType
 
Constructor Summary
AdaptedAccessor(Class<OnWireValueT> targetType, Accessor<BeanT,InMemValueT> extThis, Class<? extends XmlAdapter<OnWireValueT,InMemValueT>> adapter)
           
 
Method Summary
 OnWireValueT get(BeanT bean)
          Gets the value of the property of the given bean object.
 Object getUnadapted(BeanT bean)
          Sets the value without adapting the value.
 boolean isAdapted()
          Returns true if this accessor wraps an adapter.
 void set(BeanT bean, OnWireValueT o)
          Sets the value of the property of the given bean object.
 void setUnadapted(BeanT bean, Object value)
          Sets the value without adapting the value.
 
Methods inherited from class com.sun.xml.bind.v2.runtime.reflect.Accessor
adapt, adapt, getErrorInstance, getValueType, optimize, receive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdaptedAccessor

AdaptedAccessor(Class<OnWireValueT> targetType,
                Accessor<BeanT,InMemValueT> extThis,
                Class<? extends XmlAdapter<OnWireValueT,InMemValueT>> adapter)
Method Detail

isAdapted

public boolean isAdapted()
Description copied from class: Accessor
Returns true if this accessor wraps an adapter. This method needs to be used with care, but it helps some optimization.

Overrides:
isAdapted in class Accessor<BeanT,OnWireValueT>

get

public OnWireValueT get(BeanT bean)
                 throws AccessorException
Description copied from class: Accessor
Gets the value of the property of the given bean object.

Specified by:
get in class Accessor<BeanT,OnWireValueT>
Parameters:
bean - must not be null.
Throws:
AccessorException - if failed to set a value. For example, the getter method may throw an exception.

set

public void set(BeanT bean,
                OnWireValueT o)
         throws AccessorException
Description copied from class: Accessor
Sets the value of the property of the given bean object.

Specified by:
set in class Accessor<BeanT,OnWireValueT>
Parameters:
bean - must not be null.
o - 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.

getUnadapted

public Object getUnadapted(BeanT bean)
                    throws AccessorException
Description copied from class: Accessor
Sets the value without adapting the value. This ugly entry point is only used by JAX-WS. See JAXBRIContext.getElementPropertyAccessor(java.lang.Class, java.lang.String, java.lang.String)

Overrides:
getUnadapted in class Accessor<BeanT,OnWireValueT>
Throws:
AccessorException

setUnadapted

public void setUnadapted(BeanT bean,
                         Object value)
                  throws AccessorException
Description copied from class: Accessor
Sets the value without adapting the value. This ugly entry point is only used by JAX-WS. See JAXBRIContext.getElementPropertyAccessor(java.lang.Class, java.lang.String, java.lang.String)

Overrides:
setUnadapted in class Accessor<BeanT,OnWireValueT>
Throws:
AccessorException