Package com.thoughtworks.xstream.mapper
Class LocalConversionMapper
- java.lang.Object
-
- com.thoughtworks.xstream.mapper.MapperWrapper
-
- com.thoughtworks.xstream.mapper.LocalConversionMapper
-
- All Implemented Interfaces:
Mapper
public class LocalConversionMapper extends MapperWrapper
A Mapper for locally defined converters for a member field.- Since:
- 1.3
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.thoughtworks.xstream.mapper.Mapper
Mapper.ImplicitCollectionMapping, Mapper.Null
-
-
Field Summary
Fields Modifier and Type Field Description private AttributeMapperattributeMapperprivate MemberStorelocalConverters
-
Constructor Summary
Constructors Constructor Description LocalConversionMapper(Mapper wrapped)Constructs a LocalConversionMapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SingleValueConvertergetConverterFromAttribute(java.lang.Class definedIn, java.lang.String attribute, java.lang.Class type)Returns which converter to use for an specific attribute in a type.SingleValueConvertergetConverterFromItemType(java.lang.String fieldName, java.lang.Class type, java.lang.Class definedIn)Returns a single value converter to be used in a specific field.ConvertergetLocalConverter(java.lang.Class definedIn, java.lang.String fieldName)private SingleValueConvertergetLocalSingleValueConverter(java.lang.Class definedIn, java.lang.String fieldName, java.lang.Class type)private java.lang.ObjectreadResolve()voidregisterLocalConverter(java.lang.Class definedIn, java.lang.String fieldName, Converter converter)-
Methods inherited from class com.thoughtworks.xstream.mapper.MapperWrapper
aliasForAttribute, aliasForAttribute, aliasForSystemAttribute, attributeForAlias, attributeForAlias, defaultImplementationOf, getConverterFromAttribute, getConverterFromAttribute, getConverterFromItemType, getConverterFromItemType, getFieldNameForItemTypeAndName, getImplicitCollectionDefForFieldName, getItemTypeForItemFieldName, isIgnoredElement, isImmutableValueType, isReferenceable, lookupMapperOfType, realClass, realMember, serializedClass, serializedMember, shouldSerializeMember
-
-
-
-
Field Detail
-
localConverters
private final MemberStore localConverters
-
attributeMapper
private transient AttributeMapper attributeMapper
-
-
Constructor Detail
-
LocalConversionMapper
public LocalConversionMapper(Mapper wrapped)
Constructs a LocalConversionMapper.- Parameters:
wrapped-- Since:
- 1.3
-
-
Method Detail
-
registerLocalConverter
public void registerLocalConverter(java.lang.Class definedIn, java.lang.String fieldName, Converter converter)
-
getLocalConverter
public Converter getLocalConverter(java.lang.Class definedIn, java.lang.String fieldName)
- Specified by:
getLocalConverterin interfaceMapper- Overrides:
getLocalConverterin classMapperWrapper
-
getConverterFromAttribute
public SingleValueConverter getConverterFromAttribute(java.lang.Class definedIn, java.lang.String attribute, java.lang.Class type)
Description copied from interface:MapperReturns which converter to use for an specific attribute in a type.- Specified by:
getConverterFromAttributein interfaceMapper- Overrides:
getConverterFromAttributein classMapperWrapper- Parameters:
definedIn- the field's parentattribute- the attribute nametype- the type the converter should create
-
getConverterFromItemType
public SingleValueConverter getConverterFromItemType(java.lang.String fieldName, java.lang.Class type, java.lang.Class definedIn)
Description copied from interface:MapperReturns a single value converter to be used in a specific field.- Specified by:
getConverterFromItemTypein interfaceMapper- Overrides:
getConverterFromItemTypein classMapperWrapper- Parameters:
fieldName- the field nametype- the field typedefinedIn- the type which defines this field- Returns:
- a SingleValueConverter or null if there no such converter should be used for this field.
-
getLocalSingleValueConverter
private SingleValueConverter getLocalSingleValueConverter(java.lang.Class definedIn, java.lang.String fieldName, java.lang.Class type)
-
readResolve
private java.lang.Object readResolve()
-
-