Class NamedCollectionConverter
- java.lang.Object
-
- com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter
-
- com.thoughtworks.xstream.converters.collections.CollectionConverter
-
- com.thoughtworks.xstream.converters.extended.NamedCollectionConverter
-
- All Implemented Interfaces:
Converter
,ConverterMatcher
public class NamedCollectionConverter extends CollectionConverter
A collection converter that uses predefined names for its items.To be used as local converter. Note, suppress the usage of the implicit type argument, if registered with annotation.
- Since:
- 1.4.5
- Author:
- Jörg Schaible
-
-
Constructor Summary
Constructors Constructor Description NamedCollectionConverter(Mapper mapper, java.lang.String itemName, java.lang.Class itemType)
Constructs a NamedCollectionConverter.NamedCollectionConverter(java.lang.Class type, Mapper mapper, java.lang.String itemName, java.lang.Class itemType)
Constructs a NamedCollectionConverter handling an explicit Collection type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Object
readItem(HierarchicalStreamReader reader, UnmarshallingContext context, java.lang.Object current)
protected void
writeItem(java.lang.Object item, MarshallingContext context, HierarchicalStreamWriter writer)
-
Methods inherited from class com.thoughtworks.xstream.converters.collections.CollectionConverter
addCurrentElementToCollection, canConvert, createCollection, marshal, populateCollection, populateCollection, unmarshal
-
Methods inherited from class com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter
mapper
-
-
-
-
Constructor Detail
-
NamedCollectionConverter
public NamedCollectionConverter(Mapper mapper, java.lang.String itemName, java.lang.Class itemType)
Constructs a NamedCollectionConverter.- Parameters:
mapper
- the mapperitemName
- the name of the itemsitemType
- the base type of the items- Since:
- 1.4.5
-
NamedCollectionConverter
public NamedCollectionConverter(java.lang.Class type, Mapper mapper, java.lang.String itemName, java.lang.Class itemType)
Constructs a NamedCollectionConverter handling an explicit Collection type.- Parameters:
type
- the Collection type to handlemapper
- the mapperitemName
- the name of the itemsitemType
- the base type of the items- Since:
- 1.4.5
-
-
Method Detail
-
writeItem
protected void writeItem(java.lang.Object item, MarshallingContext context, HierarchicalStreamWriter writer)
- Overrides:
writeItem
in classAbstractCollectionConverter
-
readItem
protected java.lang.Object readItem(HierarchicalStreamReader reader, UnmarshallingContext context, java.lang.Object current)
- Overrides:
readItem
in classAbstractCollectionConverter
-
-