Top Description Fields Constructors Methods
com.thoughtworks.xstream.mapper

public Class SecurityMapper

extends MapperWrapper
Class Inheritance
Imports
java.util.ArrayList, .Arrays, .List, com.thoughtworks.xstream.security.AnyTypePermission, .ForbiddenClassException, .NoTypePermission, .TypePermission

A Mapper implementation injecting a security layer based on permission rules for any type required in the unmarshalling process.
Author
Jörg Schaible
Since
1.4.7

Field Summary

Modifier and TypeField and Description
private final List<E>

Constructor Summary

AccessConstructor and Description
public
SecurityMapper(final Mapper
the mapper chain
wrapped
)

Construct a SecurityMapper.

public
SecurityMapper(final Mapper
the mapper chain
wrapped
,
final TypePermission[]
the predefined permissions
permissions
)

Construct a SecurityMapper.

Method Summary

Modifier and TypeMethod and Description
public void
addPermission(final TypePermission
the permission to add.
permission
)

Add a new permission.

public Class<T>
realClass(final String elementName)

Overrides com.thoughtworks.xstream.mapper.MapperWrapper.realClass.

Implements com.thoughtworks.xstream.mapper.Mapper.realClass.

How a serialized class representation should be mapped back to a real class.
Inherited from com.thoughtworks.xstream.mapper.MapperWrapper:
aliasForAttributealiasForAttributealiasForSystemAttributeattributeForAliasattributeForAliasdefaultImplementationOfgetConverterFromAttributegetConverterFromAttributegetConverterFromAttributegetConverterFromItemTypegetConverterFromItemTypegetConverterFromItemTypegetFieldNameForItemTypeAndNamegetImplicitCollectionDefForFieldNamegetItemTypeForItemFieldNamegetLocalConverterisIgnoredElementisImmutableValueTypeisReferenceablelookupMapperOfTyperealMemberserializedClassserializedMembershouldSerializeMember

Field Detail

permissionsback to summary
private final List<E> permissions

Constructor Detail

SecurityMapperback to summary
public SecurityMapper(final Mapper wrapped)

Construct a SecurityMapper.

Parameters
wrapped:Mapper

the mapper chain

Since
1.4.7
SecurityMapperback to summary
public SecurityMapper(final Mapper wrapped, final TypePermission[] permissions)

Construct a SecurityMapper.

Parameters
wrapped:Mapper

the mapper chain

permissions:TypePermission[]

the predefined permissions

Since
1.4.7

Method Detail

addPermissionback to summary
public void addPermission(final TypePermission permission)

Add a new permission.

Permissions are evaluated in the added sequence. An instance of NoTypePermission or AnyTypePermission will implicitly wipe any existing permission.

Parameters
permission:TypePermission

the permission to add.

Since
1.4.7
realClassback to summary
public Class<T> realClass(final String elementName)

Overrides com.thoughtworks.xstream.mapper.MapperWrapper.realClass.

Implements com.thoughtworks.xstream.mapper.Mapper.realClass.

Doc from com.thoughtworks.xstream.mapper.Mapper.realClass.

How a serialized class representation should be mapped back to a real class.