Package com.thoughtworks.xstream.mapper
Class MapperWrapper
java.lang.Object
com.thoughtworks.xstream.mapper.MapperWrapper
- All Implemented Interfaces:
Mapper
- Direct Known Subclasses:
AbstractAttributeAliasingMapper
,AbstractXmlFriendlyMapper
,AnnotationMapper
,ArrayMapper
,AttributeMapper
,CachingMapper
,CGLIBMapper
,ClassAliasingMapper
,DefaultImplementationsMapper
,DynamicProxyMapper
,ElementIgnoringMapper
,EnumMapper
,FieldAliasingMapper
,ImmutableTypesMapper
,ImplicitCollectionMapper
,LambdaMapper
,LocalConversionMapper
,OuterClassMapper
,PackageAliasingMapper
,SecurityMapper
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.thoughtworks.xstream.mapper.Mapper
Mapper.ImplicitCollectionMapping, Mapper.Null
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Mapper
private final Mapper
private final Mapper
private final Mapper
private final Mapper
private final Mapper
private final Mapper
private final Mapper
private final Mapper
private final Mapper
private final Mapper
private final Mapper
private final Mapper
private final Mapper
private final Mapper
private final Mapper
private final Mapper
private final Mapper
private final Mapper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaliasForAttribute
(Class definedIn, String fieldName) Deprecated.aliasForAttribute
(String attribute) Get the alias for an attribute's name.aliasForSystemAttribute
(String attribute) Get the alias for a system attribute's name.attributeForAlias
(Class definedIn, String alias) Deprecated.As of 1.3, use combination ofrealMember(Class, String)
andgetConverterFromItemType(String, Class, Class)
attributeForAlias
(String alias) Get the attribute's name for an alias.defaultImplementationOf
(Class type) getConverterFromAttribute
(Class type, String attribute) Deprecated.As of 1.3.1, usegetConverterFromAttribute(Class, String, Class)
getConverterFromAttribute
(Class definedIn, String attribute, Class type) Returns which converter to use for an specific attribute in a type.Deprecated.As of 1.3, usegetConverterFromAttribute(Class, String, Class)
Deprecated.As of 1.3, usegetConverterFromItemType(String, Class, Class)
getConverterFromItemType
(String fieldName, Class type) Deprecated.As of 1.3, usegetConverterFromItemType(String, Class, Class)
getConverterFromItemType
(String fieldName, Class type, Class definedIn) Returns a single value converter to be used in a specific field.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.getImplicitCollectionDefForFieldName
(Class itemType, String fieldName) getItemTypeForItemFieldName
(Class definedIn, String itemFieldName) getLocalConverter
(Class definedIn, String fieldName) boolean
isIgnoredElement
(String name) Whether this name can be ignored.boolean
isImmutableValueType
(Class type) Whether this type is a simple immutable value (int, boolean, String, URL, etc).boolean
isReferenceable
(Class type) Whether this type is referenceable in a stream.lookupMapperOfType
(Class type) How a serialized class representation should be mapped back to a real class.realMember
(Class type, String serialized) How a serialized member representation should be mapped back to a real member.serializedClass
(Class type) How a class name should be represented in its serialized form.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.
-
Field Details
-
wrapped
-
aliasForAttributeMapper
-
aliasForSystemAttributeMapper
-
attributeForAliasMapper
-
defaultImplementationOfMapper
-
getConverterFromAttributeMapper
-
getConverterFromItemTypeMapper
-
getFieldNameForItemTypeAndNameMapper
-
getImplicitCollectionDefForFieldNameMapper
-
getItemTypeForItemFieldNameMapper
-
getLocalConverterMapper
-
isIgnoredElementMapper
-
isImmutableValueTypeMapper
-
isReferenceableMapper
-
realClassMapper
-
realMemberMapper
-
serializedClassMapper
-
serializedMemberMapper
-
shouldSerializeMemberMapper
-
-
Constructor Details
-
MapperWrapper
-
-
Method Details
-
serializedClass
Description copied from interface:Mapper
How a class name should be represented in its serialized form.- Specified by:
serializedClass
in interfaceMapper
-
realClass
Description copied from interface:Mapper
How a serialized class representation should be mapped back to a real class. -
serializedMember
Description copied from interface:Mapper
How a class member should be represented in its serialized form.- Specified by:
serializedMember
in interfaceMapper
-
realMember
Description copied from interface:Mapper
How a serialized member representation should be mapped back to a real member.- Specified by:
realMember
in interfaceMapper
-
isImmutableValueType
Description copied from interface:Mapper
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.- Specified by:
isImmutableValueType
in interfaceMapper
-
isReferenceable
Description copied from interface:Mapper
Whether this type is referenceable in a stream.- Specified by:
isReferenceable
in interfaceMapper
-
defaultImplementationOf
- Specified by:
defaultImplementationOf
in interfaceMapper
-
aliasForAttribute
Description copied from interface:Mapper
Get the alias for an attribute's name.- Specified by:
aliasForAttribute
in interfaceMapper
- Parameters:
attribute
- the attribute- Returns:
- the alias
-
attributeForAlias
Description copied from interface:Mapper
Get the attribute's name for an alias.- Specified by:
attributeForAlias
in interfaceMapper
- Parameters:
alias
- the alias- Returns:
- the attribute's name
-
aliasForSystemAttribute
Description copied from interface:Mapper
Get the alias for a system attribute's name.- Specified by:
aliasForSystemAttribute
in interfaceMapper
- Parameters:
attribute
- the system attribute- Returns:
- the alias
-
getFieldNameForItemTypeAndName
Description copied from interface:Mapper
Get the name of the field that acts as the default collection for an object, or return null if there is none.- Specified by:
getFieldNameForItemTypeAndName
in interfaceMapper
- Parameters:
definedIn
- owning typeitemType
- item typeitemFieldName
- optional item element name
-
getItemTypeForItemFieldName
- Specified by:
getItemTypeForItemFieldName
in interfaceMapper
-
getImplicitCollectionDefForFieldName
public Mapper.ImplicitCollectionMapping getImplicitCollectionDefForFieldName(Class itemType, String fieldName) - Specified by:
getImplicitCollectionDefForFieldName
in interfaceMapper
-
shouldSerializeMember
Description copied from interface:Mapper
Determine whether a specific member should be serialized.- Specified by:
shouldSerializeMember
in interfaceMapper
-
isIgnoredElement
Description copied from interface:Mapper
Whether this name can be ignored.- Specified by:
isIgnoredElement
in interfaceMapper
-
getConverterFromItemType
Deprecated.As of 1.3, usegetConverterFromItemType(String, Class, Class)
- Specified by:
getConverterFromItemType
in interfaceMapper
-
getConverterFromItemType
Deprecated.As of 1.3, usegetConverterFromItemType(String, Class, Class)
- Specified by:
getConverterFromItemType
in interfaceMapper
-
getConverterFromAttribute
Deprecated.As of 1.3, usegetConverterFromAttribute(Class, String, Class)
- Specified by:
getConverterFromAttribute
in interfaceMapper
-
getLocalConverter
- Specified by:
getLocalConverter
in interfaceMapper
-
lookupMapperOfType
- Specified by:
lookupMapperOfType
in interfaceMapper
-
getConverterFromItemType
Description copied from interface:Mapper
Returns a single value converter to be used in a specific field.- Specified by:
getConverterFromItemType
in interfaceMapper
- Parameters:
fieldName
- the field nametype
- the field typedefinedIn
- the type which defines this field- Returns:
- a SingleValueConverter or null if there no such converter should be used for this field.
-
aliasForAttribute
Deprecated.As of 1.3, use combination ofserializedMember(Class, String)
andgetConverterFromItemType(String, Class, Class)
Description copied from interface:Mapper
Returns an alias for a single field defined in an specific type.- Specified by:
aliasForAttribute
in interfaceMapper
- Parameters:
definedIn
- the type where the field was definedfieldName
- the field name- Returns:
- the alias for this field or its own name if no alias was defined
-
attributeForAlias
Deprecated.As of 1.3, use combination ofrealMember(Class, String)
andgetConverterFromItemType(String, Class, Class)
Description copied from interface:Mapper
Returns the field name for an aliased attribute.- Specified by:
attributeForAlias
in interfaceMapper
- Parameters:
definedIn
- the type where the field was definedalias
- the alias- Returns:
- the original attribute name
-
getConverterFromAttribute
Deprecated.As of 1.3.1, usegetConverterFromAttribute(Class, String, Class)
Description copied from interface:Mapper
Returns which converter to use for an specific attribute in a type.- Specified by:
getConverterFromAttribute
in interfaceMapper
- Parameters:
type
- the field's parentattribute
- the attribute name
-
getConverterFromAttribute
public SingleValueConverter getConverterFromAttribute(Class definedIn, String attribute, Class type) Description copied from interface:Mapper
Returns which converter to use for an specific attribute in a type.- Specified by:
getConverterFromAttribute
in interfaceMapper
- Parameters:
definedIn
- the field's parentattribute
- the attribute nametype
- the type the converter should create
-
serializedMember(Class, String)
andgetConverterFromItemType(String, Class, Class)