Package com.thoughtworks.xstream.mapper
Class DefaultImplementationsMapper
- java.lang.Object
-
- com.thoughtworks.xstream.mapper.MapperWrapper
-
- com.thoughtworks.xstream.mapper.DefaultImplementationsMapper
-
- All Implemented Interfaces:
Mapper
public class DefaultImplementationsMapper extends MapperWrapper
Mapper that resolves default implementations of classes. For example, mapper.serializedClass(ArrayList.class) will return java.util.List. Calling mapper.defaultImplementationOf(List.class) will return ArrayList.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.thoughtworks.xstream.mapper.Mapper
Mapper.ImplicitCollectionMapping, Mapper.Null
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map
implToType
private java.util.Map
typeToImpl
-
Constructor Summary
Constructors Constructor Description DefaultImplementationsMapper(Mapper wrapped)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDefaultImplementation(java.lang.Class defaultImplementation, java.lang.Class ofType)
protected void
addDefaults()
java.lang.Class
defaultImplementationOf(java.lang.Class type)
private java.lang.Object
readResolve()
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, aliasForSystemAttribute, attributeForAlias, attributeForAlias, getConverterFromAttribute, getConverterFromAttribute, getConverterFromAttribute, getConverterFromItemType, getConverterFromItemType, getConverterFromItemType, getFieldNameForItemTypeAndName, getImplicitCollectionDefForFieldName, getItemTypeForItemFieldName, getLocalConverter, isIgnoredElement, isImmutableValueType, isReferenceable, lookupMapperOfType, realClass, realMember, serializedMember, shouldSerializeMember
-
-
-
-
Constructor Detail
-
DefaultImplementationsMapper
public DefaultImplementationsMapper(Mapper wrapped)
-
-
Method Detail
-
addDefaults
protected void addDefaults()
-
addDefaultImplementation
public void addDefaultImplementation(java.lang.Class defaultImplementation, java.lang.Class ofType)
-
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 interfaceMapper
- Overrides:
serializedClass
in classMapperWrapper
-
defaultImplementationOf
public java.lang.Class defaultImplementationOf(java.lang.Class type)
- Specified by:
defaultImplementationOf
in interfaceMapper
- Overrides:
defaultImplementationOf
in classMapperWrapper
-
readResolve
private java.lang.Object readResolve()
-
-