org.kuali.rice.core.util.jaxb
Class RiceXmlExportList<E,T>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by org.kuali.rice.core.util.jaxb.RiceXmlExportList<E,T>
All Implemented Interfaces:
Serializable, Iterable<E>, Collection<E>, List<E>

public final class RiceXmlExportList<E,T>
extends AbstractList<E>
implements Serializable

Custom subclass of AbstractList that, whenever the "get" method is called, will pass an internally-stored list's object to the given listener for conversion into another object matching the list's type. This allows for the marshalling process to discard generated items after they have been marshalled.

These lists are constructed by passing in another list containing the unconverted items, as well as a listener that will create items of this list's type upon each invocation of the "get" method.

This is similar to the "streaming" unmarshalling strategy used in the RiceXmlImportList class, except that this list has been adapted for marshalling instead.

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
RiceXmlExportList(List<? extends T> sourceList, RiceXmlListGetterListener<E,T> listGetterListener)
          Constructs a new export list that will rely on the given listener for converting the provided list's items into the appropriate type.
 
Method Summary
 E get(int index)
          Passes the item at the given index of the internal list to the listener, and then returns the listener's result.
 int size()
          Returns the size of the internal list.
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Constructor Detail

RiceXmlExportList

public RiceXmlExportList(List<? extends T> sourceList,
                         RiceXmlListGetterListener<E,T> listGetterListener)
Constructs a new export list that will rely on the given listener for converting the provided list's items into the appropriate type.

Parameters:
sourceList - The list of objects to convert.
listGetterListener - The listener to use.
Throws:
IllegalArgumentException - if sourceList or listGetterListener are null.
Method Detail

get

public E get(int index)
Passes the item at the given index of the internal list to the listener, and then returns the listener's result.

Specified by:
get in interface List<E>
Specified by:
get in class AbstractList<E>
Parameters:
index - The unconverted item's index in the internal list.
Returns:
The item converted by the listener at the given list index.

size

public int size()
Returns the size of the internal list.

Specified by:
size in interface Collection<E>
Specified by:
size in interface List<E>
Specified by:
size in class AbstractCollection<E>
Returns:
The size of the internal list.


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.