flattree.xstream
Class AttributePreferringMapper

java.lang.Object
  extended by com.thoughtworks.xstream.mapper.MapperWrapper
      extended by flattree.xstream.AttributePreferringMapper
All Implemented Interfaces:
com.thoughtworks.xstream.mapper.Mapper

public class AttributePreferringMapper
extends com.thoughtworks.xstream.mapper.MapperWrapper

A MapperWrapper which preferres to use attributes if a suitable SingleValueConverter is available.

See Also:
getConverterFromItemType(String, Class, Class), getConverterFromAttribute(Class, String, Class)

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.thoughtworks.xstream.mapper.Mapper
com.thoughtworks.xstream.mapper.Mapper.ImplicitCollectionMapping, com.thoughtworks.xstream.mapper.Mapper.Null
 
Constructor Summary
AttributePreferringMapper(com.thoughtworks.xstream.mapper.MapperWrapper next, com.thoughtworks.xstream.converters.ConverterLookup lookup)
           
 
Method Summary
 com.thoughtworks.xstream.converters.SingleValueConverter getConverterFromAttribute(Class definedIn, String attribute, Class type)
           
 com.thoughtworks.xstream.converters.SingleValueConverter getConverterFromItemType(String fieldName, Class type, Class definedIn)
           
 
Methods inherited from class com.thoughtworks.xstream.mapper.MapperWrapper
aliasForAttribute, aliasForAttribute, aliasForSystemAttribute, attributeForAlias, attributeForAlias, attributeForClassDefiningField, attributeForEnumType, attributeForImplementationClass, attributeForReadResolveField, defaultImplementationOf, getConverterFromAttribute, getConverterFromAttribute, getConverterFromItemType, getConverterFromItemType, getFieldNameForItemTypeAndName, getImplicitCollectionDefForFieldName, getItemTypeForItemFieldName, getLocalConverter, 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

AttributePreferringMapper

public AttributePreferringMapper(com.thoughtworks.xstream.mapper.MapperWrapper next,
                                 com.thoughtworks.xstream.converters.ConverterLookup lookup)
Method Detail

getConverterFromItemType

public com.thoughtworks.xstream.converters.SingleValueConverter getConverterFromItemType(String fieldName,
                                                                                         Class type,
                                                                                         Class definedIn)
Specified by:
getConverterFromItemType in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
getConverterFromItemType in class com.thoughtworks.xstream.mapper.MapperWrapper

getConverterFromAttribute

public com.thoughtworks.xstream.converters.SingleValueConverter getConverterFromAttribute(Class definedIn,
                                                                                          String attribute,
                                                                                          Class type)
Specified by:
getConverterFromAttribute in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
getConverterFromAttribute in class com.thoughtworks.xstream.mapper.MapperWrapper


Copyright © 2011. All Rights Reserved.