Package com.thoughtworks.xstream.mapper
Interface Mapper
- All Known Implementing Classes:
AbstractAttributeAliasingMapper
,AbstractXmlFriendlyMapper
,AnnotationMapper
,ArrayMapper
,AttributeAliasingMapper
,AttributeMapper
,CachingMapper
,CGLIBMapper
,ClassAliasingMapper
,DefaultImplementationsMapper
,DefaultMapper
,DynamicProxyMapper
,ElementIgnoringMapper
,EnumMapper
,FieldAliasingMapper
,ImmutableTypesMapper
,ImplicitCollectionMapper
,LambdaMapper
,LocalConversionMapper
,MapperWrapper
,OuterClassMapper
,PackageAliasingMapper
,SecurityMapper
,SystemAttributeAliasingMapper
,UseAttributeForEnumMapper
,XmlFriendlyMapper
,XStream11XmlFriendlyMapper
public interface Mapper
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
static class
Place holder type used for null values. -
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 definedIn, 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.
-
Method Details
-
serializedClass
How a class name should be represented in its serialized form. -
realClass
How a serialized class representation should be mapped back to a real class. -
serializedMember
How a class member should be represented in its serialized form. -
realMember
How a serialized member representation should be mapped back to a real member. -
isImmutableValueType
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. -
isReferenceable
Whether this type is referenceable in a stream.- Since:
- 1.4.9
-
defaultImplementationOf
-
aliasForAttribute
Get the alias for an attribute's name.- Parameters:
attribute
- the attribute- Returns:
- the alias
- Since:
- 1.2
-
attributeForAlias
Get the attribute's name for an alias.- Parameters:
alias
- the alias- Returns:
- the attribute's name
- Since:
- 1.2
-
aliasForSystemAttribute
Get the alias for a system attribute's name.- Parameters:
attribute
- the system attribute- Returns:
- the alias
- Since:
- 1.3.1
-
getFieldNameForItemTypeAndName
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 typeitemType
- item typeitemFieldName
- optional item element name
-
getItemTypeForItemFieldName
-
getImplicitCollectionDefForFieldName
Mapper.ImplicitCollectionMapping getImplicitCollectionDefForFieldName(Class itemType, String fieldName) -
shouldSerializeMember
Determine whether a specific member should be serialized.- Since:
- 1.1.3
-
isIgnoredElement
Whether this name can be ignored.- Since:
- 1.4.9
-
getConverterFromItemType
Deprecated.As of 1.3, usegetConverterFromItemType(String, Class, Class)
-
getConverterFromItemType
Deprecated.As of 1.3, usegetConverterFromItemType(String, Class, Class)
-
getConverterFromAttribute
Deprecated.As of 1.3, usegetConverterFromAttribute(Class, String, Class)
-
getLocalConverter
-
lookupMapperOfType
-
getConverterFromItemType
Returns a single value converter to be used in a specific field.- 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.
- Since:
- 1.2.2
-
aliasForAttribute
Deprecated.As of 1.3, use combination ofserializedMember(Class, String)
andgetConverterFromItemType(String, Class, Class)
Returns an alias for a single field defined in an specific type.- 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
- Since:
- 1.2.2
-
attributeForAlias
Deprecated.As of 1.3, use combination ofrealMember(Class, String)
andgetConverterFromItemType(String, Class, Class)
Returns the field name for an aliased attribute.- Parameters:
definedIn
- the type where the field was definedalias
- the alias- Returns:
- the original attribute name
- Since:
- 1.2.2
-
getConverterFromAttribute
Deprecated.As of 1.3.1, usegetConverterFromAttribute(Class, String, Class)
Returns which converter to use for an specific attribute in a type.- Parameters:
definedIn
- the field's parentattribute
- the attribute name
-
getConverterFromAttribute
Returns which converter to use for an specific attribute in a type.- Parameters:
definedIn
- the field's parentattribute
- the attribute nametype
- the type the converter should create- Since:
- 1.3.1
-
serializedMember(Class, String)
andgetConverterFromItemType(String, Class, Class)