com.thoughtworks.xstream.mapper
Class DefaultMapper

java.lang.Object
  extended by com.thoughtworks.xstream.mapper.MapperWrapper
      extended by com.thoughtworks.xstream.mapper.DefaultMapper
All Implemented Interfaces:
ClassMapper, com.thoughtworks.xstream.mapper.Mapper

public class DefaultMapper
extends MapperWrapper

Default mapper implementation with 'vanilla' functionality. To build up the functionality required, wrap this mapper with other mapper implementations.

Author:
Joe Walnes

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.thoughtworks.xstream.alias.ClassMapper
ClassMapper.Null
 
Nested classes/interfaces inherited from interface com.thoughtworks.xstream.mapper.Mapper
com.thoughtworks.xstream.mapper.Mapper.ImplicitCollectionMapping
 
Constructor Summary
DefaultMapper(ClassLoader classLoader)
           
DefaultMapper(ClassLoader classLoader, String classAttributeIdentifier)
           
 
Method Summary
 void alias(String elementName, Class type, Class defaultImplementation)
           
 String attributeForClassDefiningField()
           
 String attributeForImplementationClass()
           
 String attributeForReadResolveField()
           
 Class defaultImplementationOf(Class type)
           
 String getFieldNameForItemTypeAndName(Class definedIn, Class itemType, String itemFieldName)
           
 com.thoughtworks.xstream.mapper.Mapper.ImplicitCollectionMapping getImplicitCollectionDefForFieldName(Class itemType, String fieldName)
           
 Class getItemTypeForItemFieldName(Class definedIn, String itemFieldName)
           
 Class getOverrideRootType()
           
 boolean isImmutableValueType(Class type)
           
 Class lookupDefaultType(Class baseType)
           
 String lookupName(Class type)
           
 Class lookupType(String elementName)
           
 String mapNameFromXML(String xmlName)
           
 String mapNameToXML(String javaName)
           
 Class realClass(String elementName)
           
 String realMember(Class type, String serialized)
           
 String serializedClass(Class type)
           
 String serializedMember(Class type, String memberName)
           
 void setOverrideRootType(Class type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMapper

public DefaultMapper(ClassLoader classLoader)

DefaultMapper

public DefaultMapper(ClassLoader classLoader,
                     String classAttributeIdentifier)
Method Detail

serializedClass

public String serializedClass(Class type)
Specified by:
serializedClass in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
serializedClass in class MapperWrapper

realClass

public Class realClass(String elementName)
Specified by:
realClass in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
realClass in class MapperWrapper

lookupDefaultType

public Class lookupDefaultType(Class baseType)
Specified by:
lookupDefaultType in interface ClassMapper
Overrides:
lookupDefaultType in class MapperWrapper

defaultImplementationOf

public Class defaultImplementationOf(Class type)
Specified by:
defaultImplementationOf in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
defaultImplementationOf in class MapperWrapper

attributeForClassDefiningField

public String attributeForClassDefiningField()
Specified by:
attributeForClassDefiningField in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
attributeForClassDefiningField in class MapperWrapper

attributeForReadResolveField

public String attributeForReadResolveField()
Specified by:
attributeForReadResolveField in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
attributeForReadResolveField in class MapperWrapper

attributeForImplementationClass

public String attributeForImplementationClass()
Specified by:
attributeForImplementationClass in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
attributeForImplementationClass in class MapperWrapper

isImmutableValueType

public boolean isImmutableValueType(Class type)
Specified by:
isImmutableValueType in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
isImmutableValueType in class MapperWrapper

getFieldNameForItemTypeAndName

public String getFieldNameForItemTypeAndName(Class definedIn,
                                             Class itemType,
                                             String itemFieldName)
Specified by:
getFieldNameForItemTypeAndName in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
getFieldNameForItemTypeAndName in class MapperWrapper

getItemTypeForItemFieldName

public Class getItemTypeForItemFieldName(Class definedIn,
                                         String itemFieldName)
Specified by:
getItemTypeForItemFieldName in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
getItemTypeForItemFieldName in class MapperWrapper

getImplicitCollectionDefForFieldName

public com.thoughtworks.xstream.mapper.Mapper.ImplicitCollectionMapping getImplicitCollectionDefForFieldName(Class itemType,
                                                                                                             String fieldName)
Specified by:
getImplicitCollectionDefForFieldName in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
getImplicitCollectionDefForFieldName in class MapperWrapper

lookupName

public String lookupName(Class type)
Specified by:
lookupName in interface ClassMapper
Overrides:
lookupName in class MapperWrapper

lookupType

public Class lookupType(String elementName)
Specified by:
lookupType in interface ClassMapper
Overrides:
lookupType in class MapperWrapper

serializedMember

public String serializedMember(Class type,
                               String memberName)
Specified by:
serializedMember in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
serializedMember in class MapperWrapper

realMember

public String realMember(Class type,
                         String serialized)
Specified by:
realMember in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
realMember in class MapperWrapper

mapNameFromXML

public String mapNameFromXML(String xmlName)
Specified by:
mapNameFromXML in interface ClassMapper
Overrides:
mapNameFromXML in class MapperWrapper

mapNameToXML

public String mapNameToXML(String javaName)
Specified by:
mapNameToXML in interface ClassMapper
Overrides:
mapNameToXML in class MapperWrapper

alias

public void alias(String elementName,
                  Class type,
                  Class defaultImplementation)
Specified by:
alias in interface ClassMapper
Overrides:
alias in class MapperWrapper

getOverrideRootType

public Class getOverrideRootType()
Specified by:
getOverrideRootType in interface ClassMapper
Overrides:
getOverrideRootType in class MapperWrapper

setOverrideRootType

public void setOverrideRootType(Class type)
Specified by:
setOverrideRootType in interface ClassMapper
Overrides:
setOverrideRootType in class MapperWrapper