com.sun.xml.bind.v2.runtime.reflect

Class Lister<BeanT,PropT,ItemT,PackT>

public abstract class Lister<BeanT,PropT,ItemT,PackT> extends Object

Used to list individual values of a multi-value property, and to pack individual values into a multi-value property.
Nested Class Summary
static classLister.CollectionLister<BeanT,T>
Lister for a collection
static classLister.IDREFSIterator
Iterator for IDREFS lister.
static classLister.Pack<ItemT>
Field Summary
static ListerERROR
static Map<Class,Lister>primitiveArrayListers
Listers for the primitive type arrays, keyed by their primitive Class object.
Constructor Summary
protected Lister()
Method Summary
abstract voidaddToPack(PackT pack, ItemT newValue)
Once the Lister is called, you can add values to the pack by using this method.
static <BeanT,PropT,ItemT,PackT> Lister<BeanT,PropT,ItemT,PackT>create(Type fieldType, ID idness, Adapter<Type,Class> adapter)
Gets a reference to the appropriate Lister object if the field is a multi-value field.
abstract voidendPacking(PackT pack, BeanT bean, Accessor<BeanT,PropT> acc)
Finally, call this method to wraps up the {@code pack}.
static <A,B,C,D> Lister<A,B,C,D>getErrorInstance()
Gets the special Lister used to recover from an error.
abstract ListIterator<ItemT>iterator(PropT multiValueProp, XMLSerializer context)
Iterates values of a multi-value property.
abstract voidreset(BeanT o, Accessor<BeanT,PropT> acc)
Clears the values of the property.
abstract PackTstartPacking(BeanT bean, Accessor<BeanT,PropT> acc)
Setting values to a multi-value property starts by creating a transient object called "pack" from the current field.

Field Detail

ERROR

public static final Lister ERROR

primitiveArrayListers

static final Map<Class,Lister> primitiveArrayListers
Listers for the primitive type arrays, keyed by their primitive Class object.

Constructor Detail

Lister

protected Lister()

Method Detail

addToPack

public abstract void addToPack(PackT pack, ItemT newValue)
Once the Lister is called, you can add values to the pack by using this method.

create

public static <BeanT,PropT,ItemT,PackT> Lister<BeanT,PropT,ItemT,PackT> create(Type fieldType, ID idness, Adapter<Type,Class> adapter)
Gets a reference to the appropriate Lister object if the field is a multi-value field. Otherwise null.

Parameters: fieldType the type of the field that stores the collection idness ID-ness of the property. adapter adapter to be used for individual items. can be null.

endPacking

public abstract void endPacking(PackT pack, BeanT bean, Accessor<BeanT,PropT> acc)
Finally, call this method to wraps up the {@code pack}. This method may update the field of the given bean.

getErrorInstance

static <A,B,C,D> Lister<A,B,C,D> getErrorInstance()
Gets the special Lister used to recover from an error.

iterator

public abstract ListIterator<ItemT> iterator(PropT multiValueProp, XMLSerializer context)
Iterates values of a multi-value property.

Parameters: context This parameter is used to support ID/IDREF handling.

reset

public abstract void reset(BeanT o, Accessor<BeanT,PropT> acc)
Clears the values of the property.

startPacking

public abstract PackT startPacking(BeanT bean, Accessor<BeanT,PropT> acc)
Setting values to a multi-value property starts by creating a transient object called "pack" from the current field.