com.thoughtworks.xstream.mapper
Class SecurityMapper

java.lang.Object
  extended by com.thoughtworks.xstream.mapper.MapperWrapper
      extended by com.thoughtworks.xstream.mapper.SecurityMapper
All Implemented Interfaces:
com.thoughtworks.xstream.mapper.Mapper

public class SecurityMapper
extends com.thoughtworks.xstream.mapper.MapperWrapper

A Mapper implementation injecting a security layer based on permission rules for any type required in the unmarshalling process.

Since:
1.4.7
Author:
Jörg Schaible

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.thoughtworks.xstream.mapper.Mapper
com.thoughtworks.xstream.mapper.Mapper.ImplicitCollectionMapping, com.thoughtworks.xstream.mapper.Mapper.Null
 
Constructor Summary
SecurityMapper(com.thoughtworks.xstream.mapper.Mapper wrapped)
          Construct a SecurityMapper.
SecurityMapper(com.thoughtworks.xstream.mapper.Mapper wrapped, TypePermission[] permissions)
          Construct a SecurityMapper.
 
Method Summary
 void addPermission(TypePermission permission)
          Add a new permission.
 java.lang.Class realClass(java.lang.String elementName)
           
 
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, realMember, serializedClass, serializedMember, shouldSerializeMember
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecurityMapper

public SecurityMapper(com.thoughtworks.xstream.mapper.Mapper wrapped)
Construct a SecurityMapper.

Parameters:
wrapped - the mapper chain
Since:
1.4.7

SecurityMapper

public SecurityMapper(com.thoughtworks.xstream.mapper.Mapper wrapped,
                      TypePermission[] permissions)
Construct a SecurityMapper.

Parameters:
wrapped - the mapper chain
permissions - 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 NoTypePermission or AnyTypePermission will 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)
Specified by:
realClass in interface com.thoughtworks.xstream.mapper.Mapper
Overrides:
realClass in class com.thoughtworks.xstream.mapper.MapperWrapper


Copyright © 2005-2016. All Rights Reserved.