com.thoughtworks.xstream.mapper
Class FieldAliasingMapper
java.lang.Object
com.thoughtworks.xstream.mapper.MapperWrapper
com.thoughtworks.xstream.mapper.FieldAliasingMapper
- All Implemented Interfaces:
- Mapper
public class FieldAliasingMapper
- extends MapperWrapper
Mapper that allows a field of a specific class to be replaced with a shorter alias, or omitted
entirely.
- Author:
- Joe Walnes
| Methods inherited from class com.thoughtworks.xstream.mapper.MapperWrapper |
aliasForAttribute, aliasForAttribute, aliasForSystemAttribute, attributeForAlias, attributeForAlias, defaultImplementationOf, getConverterFromAttribute, getConverterFromAttribute, getConverterFromAttribute, getConverterFromItemType, getConverterFromItemType, getConverterFromItemType, getFieldNameForItemTypeAndName, getImplicitCollectionDefForFieldName, getItemTypeForItemFieldName, getLocalConverter, isImmutableValueType, lookupMapperOfType, realClass, serializedClass |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
fieldToAliasMap
protected final Map fieldToAliasMap
aliasToFieldMap
protected final Map aliasToFieldMap
fieldsToOmit
protected final Set fieldsToOmit
FieldAliasingMapper
public FieldAliasingMapper(Mapper wrapped)
addFieldAlias
public void addFieldAlias(String alias,
Class type,
String fieldName)
serializedMember
public String serializedMember(Class type,
String memberName)
- Description copied from interface:
Mapper
- How a class member should be represented in its serialized form.
- Specified by:
serializedMember in interface Mapper- Overrides:
serializedMember in class MapperWrapper
realMember
public String realMember(Class type,
String serialized)
- Description copied from interface:
Mapper
- How a serialized member representation should be mapped back to a real member.
- Specified by:
realMember in interface Mapper- Overrides:
realMember in class MapperWrapper
shouldSerializeMember
public boolean shouldSerializeMember(Class definedIn,
String fieldName)
- Description copied from interface:
Mapper
- Determine whether a specific member should be serialized.
- Specified by:
shouldSerializeMember in interface Mapper- Overrides:
shouldSerializeMember in class MapperWrapper
omitField
public void omitField(Class definedIn,
String fieldName)
Copyright © 2012. All Rights Reserved.