|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.thoughtworks.xstream.mapper.DefaultMapper
public class DefaultMapper
Default mapper implementation with 'vanilla' functionality. To build up the functionality required, wrap this mapper with other mapper implementations.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.thoughtworks.xstream.mapper.Mapper |
---|
Mapper.ImplicitCollectionMapping, Mapper.Null |
Constructor Summary | |
---|---|
DefaultMapper(ClassLoader classLoader)
|
Method Summary | |
---|---|
String |
aliasForAttribute(Class definedIn,
String fieldName)
Deprecated. As of 1.3, use combination of serializedMember(Class, String) and getConverterFromItemType(String, Class, Class) |
String |
aliasForAttribute(String attribute)
Get the alias for an attribute's name. |
String |
aliasForSystemAttribute(String attribute)
Get the alias for a system attribute's name. |
String |
attributeForAlias(Class definedIn,
String alias)
Deprecated. As of 1.3, use combination of realMember(Class, String) and getConverterFromItemType(String, Class, Class) |
String |
attributeForAlias(String alias)
Get the attribute's name for an alias. |
Class |
defaultImplementationOf(Class type)
|
SingleValueConverter |
getConverterFromAttribute(Class definedIn,
String attribute)
Deprecated. As of 1.3.1, use getConverterFromAttribute(Class, String, Class) |
SingleValueConverter |
getConverterFromAttribute(Class definedIn,
String attribute,
Class type)
Returns which converter to use for an specific attribute in a type. |
SingleValueConverter |
getConverterFromAttribute(String name)
Deprecated. As of 1.3, use getConverterFromAttribute(Class, String, Class) |
SingleValueConverter |
getConverterFromItemType(Class type)
Deprecated. As of 1.3, use getConverterFromItemType(String, Class, Class) |
SingleValueConverter |
getConverterFromItemType(String fieldName,
Class type)
Deprecated. As of 1.3, use getConverterFromItemType(String, Class, Class) |
SingleValueConverter |
getConverterFromItemType(String fieldName,
Class type,
Class definedIn)
Returns a single value converter to be used in a specific field. |
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. |
Mapper.ImplicitCollectionMapping |
getImplicitCollectionDefForFieldName(Class itemType,
String fieldName)
|
Class |
getItemTypeForItemFieldName(Class definedIn,
String itemFieldName)
|
Converter |
getLocalConverter(Class definedIn,
String fieldName)
|
boolean |
isImmutableValueType(Class type)
Whether this type is a simple immutable value (int, boolean, String, URL, etc. |
Mapper |
lookupMapperOfType(Class type)
|
String |
lookupName(Class type)
|
Class |
lookupType(String elementName)
|
Class |
realClass(String elementName)
How a serialized class representation should be mapped back to a real class. |
String |
realMember(Class type,
String serialized)
How a serialized member representation should be mapped back to a real member. |
String |
serializedClass(Class type)
How a class name should be represented in its serialized form. |
String |
serializedMember(Class type,
String memberName)
How a class member should be represented in its serialized form. |
boolean |
shouldSerializeMember(Class definedIn,
String fieldName)
Determine whether a specific member should be serialized. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultMapper(ClassLoader classLoader)
Method Detail |
---|
public String serializedClass(Class type)
Mapper
serializedClass
in interface Mapper
public Class realClass(String elementName)
Mapper
realClass
in interface Mapper
public Class defaultImplementationOf(Class type)
defaultImplementationOf
in interface Mapper
public String aliasForAttribute(String attribute)
Mapper
aliasForAttribute
in interface Mapper
attribute
- the attribute
public String attributeForAlias(String alias)
Mapper
attributeForAlias
in interface Mapper
alias
- the alias
public String aliasForSystemAttribute(String attribute)
Mapper
aliasForSystemAttribute
in interface Mapper
attribute
- the system attribute
public boolean isImmutableValueType(Class type)
Mapper
isImmutableValueType
in interface Mapper
public String getFieldNameForItemTypeAndName(Class definedIn, Class itemType, String itemFieldName)
Mapper
getFieldNameForItemTypeAndName
in interface Mapper
definedIn
- owning typeitemType
- item typeitemFieldName
- optional item element namepublic Class getItemTypeForItemFieldName(Class definedIn, String itemFieldName)
getItemTypeForItemFieldName
in interface Mapper
public Mapper.ImplicitCollectionMapping getImplicitCollectionDefForFieldName(Class itemType, String fieldName)
getImplicitCollectionDefForFieldName
in interface Mapper
public boolean shouldSerializeMember(Class definedIn, String fieldName)
Mapper
shouldSerializeMember
in interface Mapper
public String lookupName(Class type)
public Class lookupType(String elementName)
public String serializedMember(Class type, String memberName)
Mapper
serializedMember
in interface Mapper
public String realMember(Class type, String serialized)
Mapper
realMember
in interface Mapper
public SingleValueConverter getConverterFromAttribute(String name)
getConverterFromAttribute(Class, String, Class)
getConverterFromAttribute
in interface Mapper
public SingleValueConverter getConverterFromItemType(String fieldName, Class type)
getConverterFromItemType(String, Class, Class)
getConverterFromItemType
in interface Mapper
public SingleValueConverter getConverterFromItemType(Class type)
getConverterFromItemType(String, Class, Class)
getConverterFromItemType
in interface Mapper
public SingleValueConverter getConverterFromItemType(String fieldName, Class type, Class definedIn)
Mapper
getConverterFromItemType
in interface Mapper
fieldName
- the field nametype
- the field typedefinedIn
- the type which defines this field
public Converter getLocalConverter(Class definedIn, String fieldName)
getLocalConverter
in interface Mapper
public Mapper lookupMapperOfType(Class type)
lookupMapperOfType
in interface Mapper
public String aliasForAttribute(Class definedIn, String fieldName)
serializedMember(Class, String)
and getConverterFromItemType(String, Class, Class)
Mapper
aliasForAttribute
in interface Mapper
definedIn
- the type where the field was definedfieldName
- the field name
public String attributeForAlias(Class definedIn, String alias)
realMember(Class, String)
and getConverterFromItemType(String, Class, Class)
Mapper
attributeForAlias
in interface Mapper
definedIn
- the type where the field was definedalias
- the alias
public SingleValueConverter getConverterFromAttribute(Class definedIn, String attribute)
getConverterFromAttribute(Class, String, Class)
Mapper
getConverterFromAttribute
in interface Mapper
definedIn
- the field's parentattribute
- the attribute namepublic SingleValueConverter getConverterFromAttribute(Class definedIn, String attribute, Class type)
Mapper
getConverterFromAttribute
in interface Mapper
definedIn
- the field's parentattribute
- the attribute nametype
- the type the converter should create
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |