|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.thoughtworks.xstream.converters.collections.AbstractCollectionConverter
com.thoughtworks.xstream.converters.collections.MapConverter
com.thoughtworks.xstream.converters.collections.SingletonMapConverter
public class SingletonMapConverter
Converts a singleton map to XML, specifying an 'entry' element with 'key' and 'value' children.
Note: 'key' and 'value' is not the name of the generated tag. The children are serialized as normal elements and the implementation expects them in the order 'key'/'value'.
Supports Collections.singletonMap.
Constructor Summary | |
---|---|
SingletonMapConverter(Mapper mapper)
Construct a SingletonMapConverter. |
Method Summary | |
---|---|
boolean |
canConvert(Class type)
Determines whether the converter can marshall a particular type. |
Object |
unmarshal(HierarchicalStreamReader reader,
UnmarshallingContext context)
Convert textual data back into an object. |
Methods inherited from class com.thoughtworks.xstream.converters.collections.MapConverter |
---|
marshal, populateMap, populateMap, putCurrentEntryIntoMap |
Methods inherited from class com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter |
---|
createCollection, mapper, readItem, writeItem |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SingletonMapConverter(Mapper mapper)
mapper
- Method Detail |
---|
public boolean canConvert(Class type)
ConverterMatcher
canConvert
in interface ConverterMatcher
canConvert
in class MapConverter
type
- the Class representing the object type to be convertedpublic Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context)
Converter
unmarshal
in interface Converter
unmarshal
in class MapConverter
reader
- The stream to read the text from.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |