com.thoughtworks.xstream.mapper
Class EnumMapper

java.lang.Object
  extended bycom.thoughtworks.xstream.mapper.MapperWrapper
      extended bycom.thoughtworks.xstream.mapper.EnumMapper
All Implemented Interfaces:
Mapper

public class EnumMapper
extends MapperWrapper

Mapper that handles the special case of polymorphic enums in Java 1.5. This renames MyEnum$1 to MyEnum making it less bloaty in the XML and avoiding the need for an alias per enum value to be specified.

Author:
Joe Walnes

Nested Class Summary
 
Nested classes inherited from class com.thoughtworks.xstream.mapper.Mapper
Mapper.ImplicitCollectionMapping, Mapper.Null
 
Constructor Summary
EnumMapper(ClassMapper wrapped)
          Deprecated. As of 1.2, use EnumMapper(Mapper)
EnumMapper(Mapper wrapped)
           
 
Method Summary
 java.lang.String serializedClass(java.lang.Class type)
          How a class name should be represented in its serialized form.
 
Methods inherited from class com.thoughtworks.xstream.mapper.MapperWrapper
aliasForAttribute, aliasForAttribute, attributeForAlias, attributeForAlias, attributeForClassDefiningField, attributeForEnumType, attributeForImplementationClass, attributeForReadResolveField, defaultImplementationOf, getConverterFromAttribute, getConverterFromAttribute, getConverterFromItemType, getConverterFromItemType, getConverterFromItemType, getFieldNameForItemTypeAndName, getImplicitCollectionDefForFieldName, getItemTypeForItemFieldName, isImmutableValueType, lookupMapperOfType, realClass, realMember, serializedMember, shouldSerializeMember
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumMapper

public EnumMapper(Mapper wrapped)

EnumMapper

public EnumMapper(ClassMapper wrapped)
Deprecated. As of 1.2, use EnumMapper(Mapper)

Method Detail

serializedClass

public java.lang.String serializedClass(java.lang.Class type)
Description copied from interface: Mapper
How a class name should be represented in its serialized form.

Specified by:
serializedClass in interface Mapper
Overrides:
serializedClass in class MapperWrapper


Joe Walnes, http://xstream.codehaus.org/