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, unmarshalmapper, readCompleteItem, readItem, writeBareItem, writeNullItempublic 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)
AbstractCollectionConverterwriteCompleteItem in class AbstractCollectionConverteritem - 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 AbstractCollectionConverterprotected java.lang.Object readBareItem(HierarchicalStreamReader reader, UnmarshallingContext context, java.lang.Object current)
AbstractCollectionConverterreadBareItem in class AbstractCollectionConverterreader - the source readercontext - the unmarshalling contextcurrent - the target collection (if already available)Copyright © 2004–2024 XStream. All rights reserved.