com.thoughtworks.xstream.mapper
Class ClassAliasingMapper
java.lang.Object
com.thoughtworks.xstream.mapper.MapperWrapper
com.thoughtworks.xstream.mapper.ClassAliasingMapper
- All Implemented Interfaces:
- Mapper
public class ClassAliasingMapper
- extends MapperWrapper
Mapper that allows a fully qualified class name to be replaced with a shorter alias.
- Author:
- Joe Walnes, Jörg Schaible
Method Summary |
void |
addClassAlias(java.lang.String name,
java.lang.Class type)
|
void |
addClassAttributeAlias(java.lang.String name,
java.lang.Class type)
Deprecated. since 1.3, method was a leftover of an old implementation |
void |
addTypeAlias(java.lang.String name,
java.lang.Class type)
|
boolean |
aliasIsAttribute(java.lang.String name)
|
boolean |
itemTypeAsAttribute(java.lang.Class clazz)
|
java.lang.Class |
realClass(java.lang.String elementName)
How a serialized class representation should be mapped back to a real class. |
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, getLocalConverter, isImmutableValueType, lookupMapperOfType, realMember, serializedMember, shouldSerializeMember |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
typeToName
protected final java.util.Map typeToName
classToName
protected final java.util.Map classToName
nameToType
protected transient java.util.Map nameToType
ClassAliasingMapper
public ClassAliasingMapper(Mapper wrapped)
ClassAliasingMapper
public ClassAliasingMapper(ClassMapper wrapped)
- Deprecated. since 1.2, use
ClassAliasingMapper(Mapper)
addClassAlias
public void addClassAlias(java.lang.String name,
java.lang.Class type)
addClassAttributeAlias
public void addClassAttributeAlias(java.lang.String name,
java.lang.Class type)
- Deprecated. since 1.3, method was a leftover of an old implementation
addTypeAlias
public void addTypeAlias(java.lang.String name,
java.lang.Class type)
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
realClass
public java.lang.Class realClass(java.lang.String elementName)
- Description copied from interface:
Mapper
- How a serialized class representation should be mapped back to a real class.
- Specified by:
realClass
in interface Mapper
- Overrides:
realClass
in class MapperWrapper
itemTypeAsAttribute
public boolean itemTypeAsAttribute(java.lang.Class clazz)
aliasIsAttribute
public boolean aliasIsAttribute(java.lang.String name)
Joe Walnes, http://xstream.codehaus.org/