Package com.thoughtworks.xstream.mapper
Class ElementIgnoringMapper
- java.lang.Object
-
- com.thoughtworks.xstream.mapper.MapperWrapper
-
- com.thoughtworks.xstream.mapper.ElementIgnoringMapper
-
- All Implemented Interfaces:
Mapper
public class ElementIgnoringMapper extends MapperWrapper
Mapper that allows an field of a specific class to be omitted entirely.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.thoughtworks.xstream.mapper.Mapper
Mapper.ImplicitCollectionMapping, Mapper.Null
-
-
Field Summary
Fields Modifier and Type Field Description private MemberDictionaryfieldsToOmitprivate java.util.MapunknownElementsToIgnore
-
Constructor Summary
Constructors Constructor Description ElementIgnoringMapper(Mapper wrapped)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddElementsToIgnore(java.util.regex.Pattern pattern)booleanisIgnoredElement(java.lang.String name)Whether this name can be ignored.voidomitField(java.lang.Class definedIn, java.lang.String fieldName)booleanshouldSerializeMember(java.lang.Class definedIn, java.lang.String fieldName)Determine whether a specific member should be serialized.-
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, isReferenceable, lookupMapperOfType, realClass, realMember, serializedClass, serializedMember
-
-
-
-
Field Detail
-
fieldsToOmit
private final MemberDictionary fieldsToOmit
-
unknownElementsToIgnore
private final java.util.Map unknownElementsToIgnore
-
-
Constructor Detail
-
ElementIgnoringMapper
public ElementIgnoringMapper(Mapper wrapped)
-
-
Method Detail
-
addElementsToIgnore
public void addElementsToIgnore(java.util.regex.Pattern pattern)
-
omitField
public void omitField(java.lang.Class definedIn, java.lang.String fieldName)
-
shouldSerializeMember
public boolean shouldSerializeMember(java.lang.Class definedIn, java.lang.String fieldName)Description copied from interface:MapperDetermine whether a specific member should be serialized.- Specified by:
shouldSerializeMemberin interfaceMapper- Overrides:
shouldSerializeMemberin classMapperWrapper
-
isIgnoredElement
public boolean isIgnoredElement(java.lang.String name)
Description copied from interface:MapperWhether this name can be ignored.- Specified by:
isIgnoredElementin interfaceMapper- Overrides:
isIgnoredElementin classMapperWrapper
-
-