Package com.thoughtworks.xstream.mapper
Class LocalConversionMapper
java.lang.Object
com.thoughtworks.xstream.mapper.MapperWrapper
com.thoughtworks.xstream.mapper.LocalConversionMapper
- All Implemented Interfaces:
Mapper
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetConverterFromAttribute
(Class definedIn, String attribute, Class type) Returns which converter to use for an specific attribute in a type.getConverterFromItemType
(String fieldName, Class type, Class definedIn) Returns a single value converter to be used in a specific field.getLocalConverter
(Class definedIn, String fieldName) private SingleValueConverter
getLocalSingleValueConverter
(Class definedIn, String fieldName, Class type) private Object
void
registerLocalConverter
(Class definedIn, 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 Details
-
localConverters
-
attributeMapper
-
-
Constructor Details
-
LocalConversionMapper
Constructs a LocalConversionMapper.- Parameters:
wrapped
-- Since:
- 1.3
-
-
Method Details
-
registerLocalConverter
-
getLocalConverter
- Specified by:
getLocalConverter
in interfaceMapper
- Overrides:
getLocalConverter
in classMapperWrapper
-
getConverterFromAttribute
public SingleValueConverter getConverterFromAttribute(Class definedIn, String attribute, Class type) Description copied from interface:Mapper
Returns which converter to use for an specific attribute in a type.- Specified by:
getConverterFromAttribute
in interfaceMapper
- Overrides:
getConverterFromAttribute
in classMapperWrapper
- Parameters:
definedIn
- the field's parentattribute
- the attribute nametype
- the type the converter should create
-
getConverterFromItemType
Description copied from interface:Mapper
Returns a single value converter to be used in a specific field.- Specified by:
getConverterFromItemType
in interfaceMapper
- Overrides:
getConverterFromItemType
in 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(Class definedIn, String fieldName, Class type) -
readResolve
-