Package com.thoughtworks.xstream.mapper
Class SecurityMapper
- java.lang.Object
-
- com.thoughtworks.xstream.mapper.MapperWrapper
-
- com.thoughtworks.xstream.mapper.SecurityMapper
-
- All Implemented Interfaces:
Mapper
public class SecurityMapper extends MapperWrapper
A Mapper implementation injecting a security layer based on permission rules for any type required in the unmarshalling process.- Since:
- 1.4.7
-
-
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 java.util.Listpermissions
-
Constructor Summary
Constructors Constructor Description SecurityMapper(Mapper wrapped)Construct a SecurityMapper.SecurityMapper(Mapper wrapped, TypePermission[] permissions)Construct a SecurityMapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPermission(TypePermission permission)Add a new permission.java.lang.ClassrealClass(java.lang.String elementName)How a serialized class representation should be mapped back to a real class.-
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, isIgnoredElement, isImmutableValueType, isReferenceable, lookupMapperOfType, realMember, serializedClass, serializedMember, shouldSerializeMember
-
-
-
-
Constructor Detail
-
SecurityMapper
public SecurityMapper(Mapper wrapped)
Construct a SecurityMapper.- Parameters:
wrapped- the mapper chain- Since:
- 1.4.7
-
SecurityMapper
public SecurityMapper(Mapper wrapped, TypePermission[] permissions)
Construct a SecurityMapper.- Parameters:
wrapped- the mapper chainpermissions- the predefined permissions- Since:
- 1.4.7
-
-
Method Detail
-
addPermission
public void addPermission(TypePermission permission)
Add a new permission.Permissions are evaluated in the added sequence. An instance of
NoTypePermissionorAnyTypePermissionwill implicitly wipe any existing permission.- Parameters:
permission- the permission to add.- Since:
- 1.4.7
-
realClass
public java.lang.Class realClass(java.lang.String elementName)
Description copied from interface:MapperHow a serialized class representation should be mapped back to a real class.- Specified by:
realClassin interfaceMapper- Overrides:
realClassin classMapperWrapper
-
-