Class SingletonMapConverter
java.lang.Object
com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter
com.thoughtworks.xstream.converters.collections.MapConverter
com.thoughtworks.xstream.converters.collections.SingletonMapConverter
- All Implemented Interfaces:
Converter, ConverterMatcher
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.
- Since:
- 1.4.2
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanConvert(Class type) Determines whether the converter can marshall a particular type.unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) Convert textual data back into an object.Methods inherited from class MapConverter
createCollection, marshal, populateMap, populateMap, putCurrentEntryIntoMapMethods inherited from class AbstractCollectionConverter
mapper, readBareItem, readCompleteItem, readItem, writeBareItem, writeCompleteItem, writeItem, writeNullItem
-
Field Details
-
MAP
-
-
Constructor Details
-
SingletonMapConverter
Construct a SingletonMapConverter.- Parameters:
mapper-- Since:
- 1.4.2
-
-
Method Details
-
canConvert
Description copied from interface:ConverterMatcherDetermines whether the converter can marshall a particular type.- Specified by:
canConvertin interfaceConverterMatcher- Overrides:
canConvertin classMapConverter- Parameters:
type- the Class representing the object type to be converted
-
unmarshal
Description copied from interface:ConverterConvert textual data back into an object.- Specified by:
unmarshalin interfaceConverter- Overrides:
unmarshalin classMapConverter- Parameters:
reader- The stream to read the text from.context-- Returns:
- The resulting object.
-