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
  • Field Details

    • permissions

      private final List permissions
  • Constructor Details

    • 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 chain
      permissions - the predefined permissions
      Since:
      1.4.7
  • Method Details

    • 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 Class realClass(String elementName)
      Description copied from interface: Mapper
      How a serialized class representation should be mapped back to a real class.
      Specified by:
      realClass in interface Mapper
      Overrides:
      realClass in class MapperWrapper