Class TreeSetConverter
java.lang.Object
com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter
com.thoughtworks.xstream.converters.collections.CollectionConverter
com.thoughtworks.xstream.converters.collections.TreeSetConverter
- All Implemented Interfaces:
Converter,ConverterMatcher
Converts a java.util.TreeSet to XML, and serializes
the associated java.util.Comparator. The converter
assumes that the elements in the XML are already sorted
according the comparator.
- Author:
- Joe Walnes, Jörg Schaible
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidmarshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) Convert an object to textual data.unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) Convert textual data back into an object.Methods inherited from class com.thoughtworks.xstream.converters.collections.CollectionConverter
addCurrentElementToCollection, canConvert, createCollection, populateCollection, populateCollectionMethods inherited from class com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter
mapper, readBareItem, readCompleteItem, readItem, writeBareItem, writeCompleteItem, writeItem, writeNullItem
-
Constructor Details
-
TreeSetConverter
-
-
Method Details
-
marshal
Description copied from interface:ConverterConvert an object to textual data.- Specified by:
marshalin interfaceConverter- Overrides:
marshalin classCollectionConverter- 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.
-
unmarshal
Description copied from interface:ConverterConvert textual data back into an object.- Specified by:
unmarshalin interfaceConverter- Overrides:
unmarshalin classCollectionConverter- Parameters:
reader- The stream to read the text from.context-- Returns:
- The resulting object.
-