Top Description Fields Constructors Methods
org.glassfish.jaxb.runtime.v2.runtime.reflect

public Class NullSafeAccessor<B, V, P>

extends Accessor<B, V>
Class Inheritance
Imports
org.glassfish.jaxb.runtime.api.AccessorException

Accessor wrapper that replaces a null with an empty collection.

This is so that JAX-WS property accessor will work like an ordinary getter.

Author
Kohsuke Kawaguchi

Field Summary

Modifier and TypeField and Description
private final Accessor<B, V>
private final Lister<B, V, ?, P>
Inherited from org.glassfish.jaxb.runtime.v2.runtime.reflect.Accessor:
JAXB_ELEMENT_VALUEvalueType

Constructor Summary

AccessConstructor and Description
public
NullSafeAccessor(Accessor<B, V> core, Lister<B, V, ?, P> lister)

Method Summary

Modifier and TypeMethod and Description
public V
get(B bean)

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.reflect.Accessor.get.

Gets the value of the property of the given bean object.

public void
set(B bean, V value)

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.reflect.Accessor.set.

Sets the value of the property of the given bean object.

Inherited from org.glassfish.jaxb.runtime.v2.runtime.reflect.Accessor:
adaptadaptgetErrorInstancegetUnadaptedgetValueTypeisAbstractableisAdaptedisValueTypeAbstractableoptimizereceivesetUnadapted

Field Detail

coreback to summary
private final Accessor<B, V> core
listerback to summary
private final Lister<B, V, ?, P> lister

Constructor Detail

NullSafeAccessorback to summary
public NullSafeAccessor(Accessor<B, V> core, Lister<B, V, ?, P> lister)

Method Detail

getback to summary
public V get(B bean) throws AccessorException

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.reflect.Accessor.get.

Doc from org.glassfish.jaxb.runtime.v2.runtime.reflect.Accessor.get.

Gets the value of the property of the given bean object.

Annotations
@Override
Exceptions
AccessorException:
if failed to set a value. For example, the getter method may throw an exception.
setback to summary
public void set(B bean, V value) throws AccessorException

Implements abstract org.glassfish.jaxb.runtime.v2.runtime.reflect.Accessor.set.

Doc from org.glassfish.jaxb.runtime.v2.runtime.reflect.Accessor.set.

Sets the value of the property of the given bean object.

Annotations
@Override
Exceptions
AccessorException:
if failed to set a value. For example, the setter method may throw an exception.