Top Inners Methods
com.thoughtworks.xstream.mapper

public Interface Mapper

Known Direct Implementers
com.thoughtworks.xstream.mapper.MapperWrapper, com.thoughtworks.xstream.mapper.DefaultMapper
Imports
com.thoughtworks.xstream.converters.Converter, .SingleValueConverter

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
public static class
Mapper.Null

Place holder type used for null values.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the alias
aliasForAttribute
(String
the attribute
attribute
)

Get the alias for an attribute's name.

public String

Returns:

the alias for this field or its own name if no alias was defined
aliasForAttribute
(Class<T>
the type where the field was defined
definedIn
,
String
the field name
fieldName
)

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

Returns:

the alias
aliasForSystemAttribute
(String
the system attribute
attribute
)

Get the alias for a system attribute's name.

public String

Returns:

the attribute's name
attributeForAlias
(String
the alias
alias
)

Get the attribute's name for an alias.

public String

Returns:

the original attribute name
attributeForAlias
(Class<T>
the type where the field was defined
definedIn
,
String
the alias
alias
)

Deprecated As of 1.3, use combination of realMember(Class, String) and getConverterFromItemType(String, Class, Class)
Returns the field name for an aliased attribute.
public Class<T>
public SingleValueConverter
public SingleValueConverter
getConverterFromAttribute(Class<T>
the field's parent
definedIn
,
String
the attribute name
attribute
)

Returns which converter to use for an specific attribute in a type.
public SingleValueConverter
getConverterFromAttribute(Class<T>
the field's parent
definedIn
,
String
the attribute name
attribute
,
Class<T>
the type the converter should create
type
)

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

public SingleValueConverter
public SingleValueConverter
public SingleValueConverter

Returns:

a SingleValueConverter or null if there no such converter should be used for this field.
getConverterFromItemType
(String
the field name
fieldName
,
Class<T>
the field type
type
,
Class<T>
the type which defines this field
definedIn
)

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

public String
getFieldNameForItemTypeAndName(Class<T>
owning type
definedIn
,
Class<T>
item type
itemType
,
String
optional item element name
itemFieldName
)

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

public Mapper.ImplicitCollectionMapping
public Class<T>
getItemTypeForItemFieldName(Class<T> definedIn, String itemFieldName)

public Converter
getLocalConverter(Class<T> definedIn, String fieldName)

public boolean
isIgnoredElement(String name)

Whether this name can be ignored.

public boolean
isImmutableValueType(Class<T> type)

Whether this type is a simple immutable value (int, boolean, String, URL, etc).

public boolean
isReferenceable(Class<T> type)

Whether this type is referenceable in a stream.

public Mapper
public Class<T>
realClass(String elementName)

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

public String
realMember(Class<T> type, String serialized)

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

public String
serializedClass(Class<T> type)

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

public String
serializedMember(Class<T> type, String memberName)

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

public boolean
shouldSerializeMember(Class<T> definedIn, String fieldName)

Determine whether a specific member should be serialized.

Method Detail

aliasForAttributeback to summary
public String aliasForAttribute(String attribute)

Get the alias for an attribute's name.

Parameters
attribute:String

the attribute

Returns:String

the alias

Since
1.2
aliasForAttributeback to summary
public String aliasForAttribute(Class<T> definedIn, String fieldName)

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

Parameters
definedIn:Class<T>

the type where the field was defined

fieldName:String

the field name

Returns:String

the alias for this field or its own name if no alias was defined

Since
1.2.2
aliasForSystemAttributeback to summary
public String aliasForSystemAttribute(String attribute)

Get the alias for a system attribute's name.

Parameters
attribute:String

the system attribute

Returns:String

the alias

Since
1.3.1
attributeForAliasback to summary
public String attributeForAlias(String alias)

Get the attribute's name for an alias.

Parameters
alias:String

the alias

Returns:String

the attribute's name

Since
1.2
attributeForAliasback to summary
public String attributeForAlias(Class<T> definedIn, String alias)

Returns the field name for an aliased attribute.

Parameters
definedIn:Class<T>

the type where the field was defined

alias:String

the alias

Returns:String

the original attribute name

Since
1.2.2
defaultImplementationOfback to summary
public Class<T> defaultImplementationOf(Class<T> type)
getConverterFromAttributeback to summary
public SingleValueConverter getConverterFromAttribute(String name)
getConverterFromAttributeback to summary
public SingleValueConverter getConverterFromAttribute(Class<T> definedIn, String attribute)

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

Parameters
definedIn:Class<T>

the field's parent

attribute:String

the attribute name

getConverterFromAttributeback to summary
public SingleValueConverter getConverterFromAttribute(Class<T> definedIn, String attribute, Class<T> type)

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

Parameters
definedIn:Class<T>

the field's parent

attribute:String

the attribute name

type:Class<T>

the type the converter should create

Since
1.3.1
getConverterFromItemTypeback to summary
public SingleValueConverter getConverterFromItemType(String fieldName, Class<T> type)
getConverterFromItemTypeback to summary
public SingleValueConverter getConverterFromItemType(Class<T> type)
getConverterFromItemTypeback to summary
public SingleValueConverter getConverterFromItemType(String fieldName, Class<T> type, Class<T> definedIn)

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

Parameters
fieldName:String

the field name

type:Class<T>

the field type

definedIn:Class<T>

the type which defines this field

Returns:SingleValueConverter

a SingleValueConverter or null if there no such converter should be used for this field.

Since
1.2.2
getFieldNameForItemTypeAndNameback to summary
public String getFieldNameForItemTypeAndName(Class<T> definedIn, Class<T> 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:Class<T>

owning type

itemType:Class<T>

item type

itemFieldName:String

optional item element name

getImplicitCollectionDefForFieldNameback to summary
public Mapper.ImplicitCollectionMapping getImplicitCollectionDefForFieldName(Class<T> itemType, String fieldName)
getItemTypeForItemFieldNameback to summary
public Class<T> getItemTypeForItemFieldName(Class<T> definedIn, String itemFieldName)
getLocalConverterback to summary
public Converter getLocalConverter(Class<T> definedIn, String fieldName)
isIgnoredElementback to summary
public boolean isIgnoredElement(String name)

Whether this name can be ignored.

Since
1.4.9
isImmutableValueTypeback to summary
public boolean isImmutableValueType(Class<T> 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.

isReferenceableback to summary
public boolean isReferenceable(Class<T> type)

Whether this type is referenceable in a stream.

Since
1.4.9
lookupMapperOfTypeback to summary
public Mapper lookupMapperOfType(Class<T> type)
realClassback to summary
public Class<T> realClass(String elementName)

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

realMemberback to summary
public String realMember(Class<T> type, String serialized)

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

serializedClassback to summary
public String serializedClass(Class<T> type)

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

serializedMemberback to summary
public String serializedMember(Class<T> type, String memberName)

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

shouldSerializeMemberback to summary
public boolean shouldSerializeMember(Class<T> definedIn, String fieldName)

Determine whether a specific member should be serialized.

Since
1.1.3
com.thoughtworks.xstream.mapper back to summary

public Interface Mapper.ImplicitCollectionMapping

Known Direct Implementers
com.thoughtworks.xstream.mapper.ImplicitCollectionMapper.ImplicitCollectionMappingImpl

Method Summary

Modifier and TypeMethod and Description
public String
public String
public Class<T>
public String

Method Detail

getFieldNameback to summary
public String getFieldName()
getItemFieldNameback to summary
public String getItemFieldName()
getItemTypeback to summary
public Class<T> getItemType()
getKeyFieldNameback to summary
public String getKeyFieldName()
com.thoughtworks.xstream.mapper back to summary

public Class Mapper.Null

extends Object
Class Inheritance
Known Direct Subclasses
com.thoughtworks.xstream.converters.collections.TreeMapConverter.NullComparator

Place holder type used for null values.

Constructor Summary

AccessConstructor and Description
public
Null()

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Nullback to summary
public Null()