public class SingletonCollectionConverter extends CollectionConverter
Supports Collections.singleton(Object) and Collections.singletonList(Object).
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.Class |
LIST |
private static java.lang.Class |
SET |
| Constructor and Description |
|---|
SingletonCollectionConverter(Mapper mapper)
Construct a SingletonCollectionConverter.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canConvert(java.lang.Class type)
Determines whether the converter can marshall a particular type.
|
java.lang.Object |
unmarshal(HierarchicalStreamReader reader,
UnmarshallingContext context)
Convert textual data back into an object.
|
addCurrentElementToCollection, createCollection, marshal, populateCollection, populateCollectionmapper, readBareItem, readCompleteItem, readItem, writeBareItem, writeCompleteItem, writeItem, writeNullItemprivate static final java.lang.Class LIST
private static final java.lang.Class SET
public SingletonCollectionConverter(Mapper mapper)
mapper - the mapperpublic boolean canConvert(java.lang.Class type)
ConverterMatchercanConvert in interface ConverterMatchercanConvert in class CollectionConvertertype - the Class representing the object type to be convertedpublic java.lang.Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context)
Converterunmarshal in interface Converterunmarshal in class CollectionConverterreader - The stream to read the text from.