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(java.lang.Class type,
Mapper mapper,
java.lang.String itemName,
java.lang.Class itemType)
Constructs a NamedCollectionConverter handling an explicit Collection type.
|
NamedCollectionConverter(Mapper mapper,
java.lang.String itemName,
java.lang.Class itemType)
Constructs a NamedCollectionConverter.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
readBareItem(HierarchicalStreamReader reader,
UnmarshallingContext context,
java.lang.Object current)
Read a bare item of the collection from the reader.
|
protected void |
writeCompleteItem(java.lang.Object item,
MarshallingContext context,
HierarchicalStreamWriter writer)
Write an item of the collection into the writer including surrounding tags.
|
protected void |
writeItem(java.lang.Object item,
MarshallingContext context,
HierarchicalStreamWriter writer)
Deprecated.
As of 1.4.11 use
writeCompleteItem(Object, MarshallingContext, HierarchicalStreamWriter)
instead. |
addCurrentElementToCollection, canConvert, createCollection, marshal, populateCollection, populateCollection, unmarshal
mapper, readCompleteItem, readItem, writeBareItem, writeNullItem
public NamedCollectionConverter(Mapper mapper, java.lang.String itemName, java.lang.Class itemType)
mapper
- the mapperitemName
- the name of the itemsitemType
- the base type of the itemspublic NamedCollectionConverter(java.lang.Class type, Mapper mapper, java.lang.String itemName, java.lang.Class itemType)
type
- the Collection type to handlemapper
- the mapperitemName
- the name of the itemsitemType
- the base type of the itemsprotected void writeCompleteItem(java.lang.Object item, MarshallingContext context, HierarchicalStreamWriter writer)
AbstractCollectionConverter
writeCompleteItem
in class AbstractCollectionConverter
item
- the item to writecontext
- the current marshalling contextwriter
- the target writerprotected void writeItem(java.lang.Object item, MarshallingContext context, HierarchicalStreamWriter writer)
writeCompleteItem(Object, MarshallingContext, HierarchicalStreamWriter)
instead.writeItem
in class AbstractCollectionConverter
protected java.lang.Object readBareItem(HierarchicalStreamReader reader, UnmarshallingContext context, java.lang.Object current)
AbstractCollectionConverter
readBareItem
in class AbstractCollectionConverter
reader
- the source readercontext
- the unmarshalling contextcurrent
- the target collection (if already available)Copyright © 2004–2022 XStream. All rights reserved.