public class NamedCollectionConverter extends CollectionConverter
To be used as local converter. Note, suppress the usage of the implicit type argument, if registered with annotation.
Constructor and Description |
---|
NamedCollectionConverter(Class type,
Mapper mapper,
String itemName,
Class itemType)
Constructs a NamedCollectionConverter handling an explicit Collection type.
|
NamedCollectionConverter(Mapper mapper,
String itemName,
Class itemType)
Constructs a NamedCollectionConverter.
|
Modifier and Type | Method and Description |
---|---|
protected Object |
readItem(HierarchicalStreamReader reader,
UnmarshallingContext context,
Object current) |
protected void |
writeItem(Object item,
MarshallingContext context,
HierarchicalStreamWriter writer) |
addCurrentElementToCollection, canConvert, createCollection, marshal, populateCollection, populateCollection, unmarshal
mapper
public NamedCollectionConverter(Mapper mapper, String itemName, Class itemType)
mapper
- the mapperitemName
- the name of the itemsitemType
- the base type of the itemspublic NamedCollectionConverter(Class type, Mapper mapper, String itemName, Class itemType)
type
- the Collection type to handlemapper
- the mapperitemName
- the name of the itemsitemType
- the base type of the itemsprotected void writeItem(Object item, MarshallingContext context, HierarchicalStreamWriter writer)
writeItem
in class AbstractCollectionConverter
protected Object readItem(HierarchicalStreamReader reader, UnmarshallingContext context, Object current)
readItem
in class AbstractCollectionConverter
Copyright © 2004–2016 XStream. All rights reserved.