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 an alias.
  • Field Details

    • typeToName

      private final Map typeToName
    • classToName

      private final Map classToName
    • nameToType

      private transient Map nameToType
  • Constructor Details

    • ClassAliasingMapper

      public ClassAliasingMapper(Mapper wrapped)
  • Method Details

    • addClassAlias

      public void addClassAlias(String name, Class type)
    • addClassAttributeAlias

      public void addClassAttributeAlias(String name, Class type)
      Deprecated.
      As of 1.3, method was a leftover of an old implementation
    • addTypeAlias

      public void addTypeAlias(String name, Class type)
    • serializedClass

      public String serializedClass(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 Class realClass(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(Class clazz)
      Deprecated.
      As of 1.4.9
    • aliasIsAttribute

      public boolean aliasIsAttribute(String name)
      Deprecated.
      As of 1.4.9
    • readResolve

      private Object readResolve()