public class SingletonCollectionConverter extends CollectionConverter
Supports Collections.singleton(Object) and Collections.singletonList(Object).
Constructor and Description |
---|
SingletonCollectionConverter(Mapper mapper)
Construct a SingletonCollectionConverter.
|
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.
|
addCurrentElementToCollection, createCollection, marshal, populateCollection, populateCollection
mapper, readItem, writeItem
public SingletonCollectionConverter(Mapper mapper)
mapper
- the mapperpublic boolean canConvert(Class type)
ConverterMatcher
canConvert
in interface ConverterMatcher
canConvert
in class CollectionConverter
type
- the Class representing the object type to be convertedpublic Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context)
Converter
unmarshal
in interface Converter
unmarshal
in class CollectionConverter
reader
- The stream to read the text from.Copyright © 2004–2017 XStream. All rights reserved.