com.sun.xml.bind.v2.runtime.reflect
Class Accessor.GetterSetterReflection<BeanT,ValueT>
java.lang.Object
com.sun.xml.bind.v2.runtime.reflect.Accessor<BeanT,ValueT>
com.sun.xml.bind.v2.runtime.reflect.Accessor.GetterSetterReflection<BeanT,ValueT>
- All Implemented Interfaces:
- Receiver
- Direct Known Subclasses:
- Accessor.GetterOnlyReflection, Accessor.SetterOnlyReflection
- Enclosing class:
- Accessor<BeanT,ValueT>
public static class Accessor.GetterSetterReflection<BeanT,ValueT>
- extends Accessor<BeanT,ValueT>
Accessor
that uses Java reflection to access a getter and a setter.
Field Summary |
java.lang.reflect.Method |
getter
|
java.lang.reflect.Method |
setter
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getter
public final java.lang.reflect.Method getter
setter
public final java.lang.reflect.Method setter
Accessor.GetterSetterReflection
public Accessor.GetterSetterReflection(java.lang.reflect.Method getter,
java.lang.reflect.Method setter)
get
public ValueT 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,ValueT>
- 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,
ValueT value)
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,ValueT>
- 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.
optimize
public Accessor<BeanT,ValueT> optimize(JAXBContextImpl context)
- Description copied from class:
Accessor
- Returns the optimized version of the same accessor.
- Overrides:
optimize
in class Accessor<BeanT,ValueT>
- Parameters:
context
- The JAXBContextImpl
that owns the whole thing.
(See RuntimeModelBuilder.context
.)
- Returns:
- At least the implementation can return this.