public class TreeMapConverter extends MapConverter
Constructor and Description |
---|
TreeMapConverter(Mapper mapper) |
Modifier and Type | Method and Description |
---|---|
void |
marshal(java.lang.Object source,
HierarchicalStreamWriter writer,
MarshallingContext context)
Convert an object to textual data.
|
protected void |
marshalComparator(java.util.Comparator comparator,
HierarchicalStreamWriter writer,
MarshallingContext context) |
protected void |
populateTreeMap(HierarchicalStreamReader reader,
UnmarshallingContext context,
java.util.TreeMap result,
java.util.Comparator comparator) |
java.lang.Object |
unmarshal(HierarchicalStreamReader reader,
UnmarshallingContext context)
Convert textual data back into an object.
|
protected java.util.Comparator |
unmarshalComparator(HierarchicalStreamReader reader,
UnmarshallingContext context,
java.util.TreeMap result) |
canConvert, createCollection, populateMap, populateMap, putCurrentEntryIntoMap
mapper, readBareItem, readCompleteItem, readItem, writeBareItem, writeCompleteItem, writeItem, writeNullItem
public TreeMapConverter(Mapper mapper)
public void marshal(java.lang.Object source, HierarchicalStreamWriter writer, MarshallingContext context)
Converter
marshal
in interface Converter
marshal
in class MapConverter
source
- The object to be marshalled.writer
- A stream to write to.context
- A context that allows nested objects to be processed by XStream.protected void marshalComparator(java.util.Comparator comparator, HierarchicalStreamWriter writer, MarshallingContext context)
public java.lang.Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context)
Converter
unmarshal
in interface Converter
unmarshal
in class MapConverter
reader
- The stream to read the text from.protected java.util.Comparator unmarshalComparator(HierarchicalStreamReader reader, UnmarshallingContext context, java.util.TreeMap result)
protected void populateTreeMap(HierarchicalStreamReader reader, UnmarshallingContext context, java.util.TreeMap result, java.util.Comparator comparator)
Copyright © 2004–2022 XStream. All rights reserved.