public class SingletonMapConverter extends MapConverter
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 and Description |
---|
SingletonMapConverter(Mapper mapper)
Construct a SingletonMapConverter.
|
Modifier and Type | Method and Description |
---|---|
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.
|
createCollection, marshal, populateMap, populateMap, putCurrentEntryIntoMap
mapper, readItem, writeItem
public SingletonMapConverter(Mapper mapper)
mapper
- 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.Copyright © 2004–2017 XStream. All rights reserved.