com.thoughtworks.xstream.mapper
Class AttributeMapper

java.lang.Object
  extended by com.thoughtworks.xstream.mapper.MapperWrapper
      extended by 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

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.thoughtworks.xstream.mapper.Mapper
Mapper.ImplicitCollectionMapping, Mapper.Null
 
Constructor Summary
AttributeMapper(Mapper wrapped)
           
AttributeMapper(Mapper wrapped, ConverterLookup converterLookup)
           
 
Method Summary
 void addAttributeFor(java.lang.Class type)
           
 void addAttributeFor(java.lang.String fieldName, java.lang.Class type)
           
 SingleValueConverter getConverterFromAttribute(java.lang.String attributeName)
           
 SingleValueConverter getConverterFromItemType(java.lang.Class type)
           
 SingleValueConverter getConverterFromItemType(java.lang.String fieldName, java.lang.Class type)
           
protected  SingleValueConverter getLocalConverterFromItemType(java.lang.Class type)
           
 void setConverterLookup(ConverterLookup converterLookup)
           
 
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
 

Constructor Detail

AttributeMapper

public AttributeMapper(Mapper wrapped)

AttributeMapper

public AttributeMapper(Mapper wrapped,
                       ConverterLookup converterLookup)
Method Detail

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/