Package org.kuali.rice.core.util.jaxb
Class RiceXmlExportList<E,T>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- 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
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Eget(int index)Passes the item at the given index of the internal list to the listener, and then returns the listener's result.intsize()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.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, 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.
-
size
public int size()
Returns the size of the internal list.- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein interfaceList<E>- Specified by:
sizein classAbstractCollection<E>- Returns:
- The size of the internal list.
-
-