Top Description Fields Constructors Methods
com.thoughtworks.xstream.mapper

public Class LocalConversionMapper

extends MapperWrapper
Class Inheritance
Imports
com.thoughtworks.xstream.converters.Converter, .SingleValueConverter, com.thoughtworks.xstream.core.util.FastField, java.util.HashMap, .Map

A Mapper for locally defined converters for a member field.
Author
Jörg Schaible
Since
1.3

Field Summary

Modifier and TypeField and Description
private transient AttributeMapper
private final Map<K, V>

Constructor Summary

AccessConstructor and Description
public
LocalConversionMapper(Mapper wrapped)

Constructs a LocalConversionMapper.

Method Summary

Modifier and TypeMethod and Description
public SingleValueConverter
getConverterFromAttribute(Class<T>
the field's parent
definedIn
,
String
the attribute name
attribute
,
Class<T>
the type the converter should create
type
)

Overrides com.thoughtworks.xstream.mapper.MapperWrapper.getConverterFromAttribute.

Implements com.thoughtworks.xstream.mapper.Mapper.getConverterFromAttribute.

Returns which converter to use for an specific attribute in a type.
public SingleValueConverter
getConverterFromItemType(String
the field name
fieldName
,
Class<T>
the field type
type
,
Class<T>
the type which defines this field
definedIn
)

Overrides com.thoughtworks.xstream.mapper.MapperWrapper.getConverterFromItemType.

Implements com.thoughtworks.xstream.mapper.Mapper.getConverterFromItemType.

Returns a single value converter to be used in a specific field.
public Converter
private SingleValueConverter
getLocalSingleValueConverter(Class<T> definedIn, String fieldName, Class<T> type)

private Object
public void
registerLocalConverter(Class<T> definedIn, String fieldName, Converter converter)

Inherited from com.thoughtworks.xstream.mapper.MapperWrapper:
aliasForAttributealiasForAttributealiasForSystemAttributeattributeForAliasattributeForAliasdefaultImplementationOfgetConverterFromAttributegetConverterFromAttributegetConverterFromItemTypegetConverterFromItemTypegetFieldNameForItemTypeAndNamegetImplicitCollectionDefForFieldNamegetItemTypeForItemFieldNameisIgnoredElementisImmutableValueTypeisReferenceablelookupMapperOfTyperealClassrealMemberserializedClassserializedMembershouldSerializeMember

Field Detail

attributeMapperback to summary
private transient AttributeMapper attributeMapper
localConvertersback to summary
private final Map<K, V> localConverters

Constructor Detail

LocalConversionMapperback to summary
public LocalConversionMapper(Mapper wrapped)

Constructs a LocalConversionMapper.

Since
1.3

Method Detail

getConverterFromAttributeback to summary
public SingleValueConverter getConverterFromAttribute(Class<T> definedIn, String attribute, Class<T> type)

Overrides com.thoughtworks.xstream.mapper.MapperWrapper.getConverterFromAttribute.

Implements com.thoughtworks.xstream.mapper.Mapper.getConverterFromAttribute.

Doc from com.thoughtworks.xstream.mapper.Mapper.getConverterFromAttribute.

Returns which converter to use for an specific attribute in a type.

Parameters
definedIn:Class<T>

the field's parent

attribute:String

the attribute name

type:Class<T>

the type the converter should create

getConverterFromItemTypeback to summary
public SingleValueConverter getConverterFromItemType(String fieldName, Class<T> type, Class<T> definedIn)

Overrides com.thoughtworks.xstream.mapper.MapperWrapper.getConverterFromItemType.

Implements com.thoughtworks.xstream.mapper.Mapper.getConverterFromItemType.

Doc from com.thoughtworks.xstream.mapper.Mapper.getConverterFromItemType.

Returns a single value converter to be used in a specific field.

Parameters
fieldName:String

the field name

type:Class<T>

the field type

definedIn:Class<T>

the type which defines this field

Returns:SingleValueConverter

a SingleValueConverter or null if there no such converter should be used for this field.

getLocalConverterback to summary
public Converter getLocalConverter(Class<T> definedIn, String fieldName)

Overrides com.thoughtworks.xstream.mapper.MapperWrapper.getLocalConverter.

Implements com.thoughtworks.xstream.mapper.Mapper.getLocalConverter.

getLocalSingleValueConverterback to summary
private SingleValueConverter getLocalSingleValueConverter(Class<T> definedIn, String fieldName, Class<T> type)
readResolveback to summary
private Object readResolve()
registerLocalConverterback to summary
public void registerLocalConverter(Class<T> definedIn, String fieldName, Converter converter)