java.lang.Object |
↳ |
com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter |
Known Direct Subclasses
ArrayConverter |
Converts an array of objects or primitives to XML, using
a nested child element for each item. |
CollectionConverter |
Converts most common Collections (Lists and Sets) to XML, specifying a nested
element for each item. |
MapConverter |
Converts a java.util.Map to XML, specifying an 'entry'
element with 'key' and 'value' children. |
SubjectConverter |
Converts a Subject instance. |
|
Known Indirect Subclasses
EnumMapConverter |
Serializes an Java 5 EnumMap, including the type of Enum it's for. |
TreeMapConverter |
Converts a java.util.TreeMap to XML, and serializes
the associated java.util.Comparator. |
TreeSetConverter |
Converts a java.util.TreeSet to XML, and serializes
the associated java.util.Comparator. |
|
Class Overview
Base helper class for converters that need to handle
collections of items (arrays, Lists, Maps, etc).
Typically, subclasses of this will converter the outer
structure of the collection, loop through the contents and
call readItem() or writeItem() for each item.
Public Constructors
public
AbstractCollectionConverter
(Mapper mapper)
Public Methods
public
abstract
boolean
canConvert
(Class type)
Determines whether the converter can marshall a particular type.
Parameters
type
| the Class representing the object type to be converted
|
Convert an object to textual data.
Parameters
source
| The object to be marshalled. |
writer
| A stream to write to. |
context
| A context that allows nested objects to be processed by XStream.
|
Convert textual data back into an object.
Parameters
reader
| The stream to read the text from. |
Protected Methods