com.thoughtworks.xstream.mapper
Class AttributeMapper
java.lang.Object
com.thoughtworks.xstream.mapper.MapperWrapper
com.thoughtworks.xstream.mapper.AttributeMapper
- All Implemented Interfaces:
- Mapper
public class AttributeMapper
- extends MapperWrapper
Mapper that allows the usage of attributes for fields and corresponding
types or specified arbitrary types. It is responsible for the lookup of the
SingleValueConverter
for item types and attribute names.
- Since:
- 1.2
- Author:
- Paul Hammant, Ian Cartwright, Jörg Schaible, Mauro Talevi
Methods inherited from class com.thoughtworks.xstream.mapper.MapperWrapper |
aliasForAttribute, attributeForAlias, attributeForClassDefiningField, attributeForEnumType, attributeForImplementationClass, attributeForReadResolveField, defaultImplementationOf, getFieldNameForItemTypeAndName, getImplicitCollectionDefForFieldName, getItemTypeForItemFieldName, isImmutableValueType, lookupMapperOfType, realClass, realMember, serializedClass, serializedMember, shouldSerializeMember |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AttributeMapper
public AttributeMapper(Mapper wrapped)
AttributeMapper
public AttributeMapper(Mapper wrapped,
ConverterLookup converterLookup)
setConverterLookup
public void setConverterLookup(ConverterLookup converterLookup)
addAttributeFor
public void addAttributeFor(java.lang.String fieldName,
java.lang.Class type)
addAttributeFor
public void addAttributeFor(java.lang.Class type)
getLocalConverterFromItemType
protected SingleValueConverter getLocalConverterFromItemType(java.lang.Class type)
getConverterFromItemType
public SingleValueConverter getConverterFromItemType(java.lang.String fieldName,
java.lang.Class type)
- Specified by:
getConverterFromItemType
in interface Mapper
- Overrides:
getConverterFromItemType
in class MapperWrapper
getConverterFromItemType
public SingleValueConverter getConverterFromItemType(java.lang.Class type)
- Specified by:
getConverterFromItemType
in interface Mapper
- Overrides:
getConverterFromItemType
in class MapperWrapper
getConverterFromAttribute
public SingleValueConverter getConverterFromAttribute(java.lang.String attributeName)
- Specified by:
getConverterFromAttribute
in interface Mapper
- Overrides:
getConverterFromAttribute
in class MapperWrapper
Joe Walnes, http://xstream.codehaus.org/