public interface

Mapper

com.thoughtworks.xstream.mapper.Mapper
Known Indirect Subclasses

Summary

Nested Classes
interface Mapper.ImplicitCollectionMapping  
class Mapper.Null Place holder type used for null values. 
Public Methods
abstract String aliasForAttribute(String attribute)
Get the alias for an attribute's name.
abstract String aliasForAttribute(Class definedIn, String fieldName)
This method is deprecated. since 1.3, use combination of serializedMember(Class, String) and getConverterFromItemType(String, Class, Class)
abstract String aliasForSystemAttribute(String attribute)
Get the alias for a system attribute's name.
abstract String attributeForAlias(Class definedIn, String alias)
This method is deprecated. since 1.3, use combination of realMember(Class, String) and getConverterFromItemType(String, Class, Class)
abstract String attributeForAlias(String alias)
Get the attribute's name for an alias.
abstract String attributeForClassDefiningField()
This method is deprecated. since 1.2, use aliasForAttribute instead.
abstract String attributeForEnumType()
This method is deprecated. since 1.2, use aliasForAttribute instead.
abstract String attributeForImplementationClass()
This method is deprecated. since 1.2, use aliasForAttribute instead.
abstract String attributeForReadResolveField()
This method is deprecated. since 1.2, use aliasForAttribute instead.
abstract Class defaultImplementationOf(Class type)
abstract SingleValueConverter getConverterFromAttribute(String name)
This method is deprecated. since 1.3, use getConverterFromAttribute(Class, String, Class)
abstract SingleValueConverter getConverterFromAttribute(Class definedIn, String attribute, Class type)
Returns which converter to use for an specific attribute in a type.
abstract SingleValueConverter getConverterFromAttribute(Class definedIn, String attribute)
This method is deprecated. since 1.3.1, use getConverterFromAttribute(Class, String, Class)
abstract SingleValueConverter getConverterFromItemType(String fieldName, Class type)
This method is deprecated. since 1.3, use getConverterFromItemType(String, Class, Class)
abstract SingleValueConverter getConverterFromItemType(Class type)
This method is deprecated. since 1.3, use getConverterFromItemType(String, Class, Class)
abstract SingleValueConverter getConverterFromItemType(String fieldName, Class type, Class definedIn)
Returns a single value converter to be used in a specific field.
abstract String getFieldNameForItemTypeAndName(Class definedIn, Class itemType, String itemFieldName)
Get the name of the field that acts as the default collection for an object, or return null if there is none.
abstract Mapper.ImplicitCollectionMapping getImplicitCollectionDefForFieldName(Class itemType, String fieldName)
abstract Class getItemTypeForItemFieldName(Class definedIn, String itemFieldName)
abstract Converter getLocalConverter(Class definedIn, String fieldName)
abstract boolean isImmutableValueType(Class type)
Whether this type is a simple immutable value (int, boolean, String, URL, etc.
abstract Mapper lookupMapperOfType(Class type)
abstract Class realClass(String elementName)
How a serialized class representation should be mapped back to a real class.
abstract String realMember(Class type, String serialized)
How a serialized member representation should be mapped back to a real member.
abstract String serializedClass(Class type)
How a class name should be represented in its serialized form.
abstract String serializedMember(Class type, String memberName)
How a class member should be represented in its serialized form.
abstract boolean shouldSerializeMember(Class definedIn, String fieldName)
Determine whether a specific member should be serialized.

Public Methods

public abstract String aliasForAttribute (String attribute)

Get the alias for an attribute's name.

Parameters
attribute the attribute
Returns
  • the alias

public abstract String aliasForAttribute (Class definedIn, String fieldName)

This method is deprecated.
since 1.3, use combination of serializedMember(Class, String) and getConverterFromItemType(String, Class, Class)

Returns an alias for a single field defined in an specific type.

Parameters
definedIn the type where the field was defined
fieldName the field name
Returns
  • the alias for this field or its own name if no alias was defined

public abstract String aliasForSystemAttribute (String attribute)

Get the alias for a system attribute's name.

Parameters
attribute the system attribute
Returns
  • the alias

public abstract String attributeForAlias (Class definedIn, String alias)

This method is deprecated.
since 1.3, use combination of realMember(Class, String) and getConverterFromItemType(String, Class, Class)

Returns the field name for an aliased attribute.

Parameters
definedIn the type where the field was defined
alias the alias
Returns
  • the original attribute name

public abstract String attributeForAlias (String alias)

Get the attribute's name for an alias.

Parameters
alias the alias
Returns
  • the attribute's name

public abstract String attributeForClassDefiningField ()

This method is deprecated.
since 1.2, use aliasForAttribute instead.

public abstract String attributeForEnumType ()

This method is deprecated.
since 1.2, use aliasForAttribute instead.

public abstract String attributeForImplementationClass ()

This method is deprecated.
since 1.2, use aliasForAttribute instead.

public abstract String attributeForReadResolveField ()

This method is deprecated.
since 1.2, use aliasForAttribute instead.

public abstract Class defaultImplementationOf (Class type)

public abstract SingleValueConverter getConverterFromAttribute (String name)

This method is deprecated.
since 1.3, use getConverterFromAttribute(Class, String, Class)

public abstract SingleValueConverter getConverterFromAttribute (Class definedIn, String attribute, Class type)

Returns which converter to use for an specific attribute in a type.

Parameters
definedIn the field's parent
attribute the attribute name
type the type the converter should create

public abstract SingleValueConverter getConverterFromAttribute (Class definedIn, String attribute)

This method is deprecated.
since 1.3.1, use getConverterFromAttribute(Class, String, Class)

Returns which converter to use for an specific attribute in a type.

Parameters
definedIn the field's parent
attribute the attribute name

public abstract SingleValueConverter getConverterFromItemType (String fieldName, Class type)

This method is deprecated.
since 1.3, use getConverterFromItemType(String, Class, Class)

public abstract SingleValueConverter getConverterFromItemType (Class type)

This method is deprecated.
since 1.3, use getConverterFromItemType(String, Class, Class)

public abstract SingleValueConverter getConverterFromItemType (String fieldName, Class type, Class definedIn)

Returns a single value converter to be used in a specific field.

Parameters
fieldName the field name
type the field type
definedIn the type which defines this field
Returns
  • a SingleValueConverter or null if there no such converter should be used for this field.

public abstract String getFieldNameForItemTypeAndName (Class definedIn, Class itemType, String itemFieldName)

Get the name of the field that acts as the default collection for an object, or return null if there is none.

Parameters
definedIn owning type
itemType item type
itemFieldName optional item element name

public abstract Mapper.ImplicitCollectionMapping getImplicitCollectionDefForFieldName (Class itemType, String fieldName)

public abstract Class getItemTypeForItemFieldName (Class definedIn, String itemFieldName)

public abstract Converter getLocalConverter (Class definedIn, String fieldName)

public abstract boolean isImmutableValueType (Class type)

Whether this type is a simple immutable value (int, boolean, String, URL, etc. Immutable types will be repeatedly written in the serialized stream, instead of using object references.

public abstract Mapper lookupMapperOfType (Class type)

public abstract Class realClass (String elementName)

How a serialized class representation should be mapped back to a real class.

public abstract String realMember (Class type, String serialized)

How a serialized member representation should be mapped back to a real member.

public abstract String serializedClass (Class type)

How a class name should be represented in its serialized form.

public abstract String serializedMember (Class type, String memberName)

How a class member should be represented in its serialized form.

public abstract boolean shouldSerializeMember (Class definedIn, String fieldName)

Determine whether a specific member should be serialized.