Class NoPermission
- java.lang.Object
-
- com.thoughtworks.xstream.security.NoPermission
-
- All Implemented Interfaces:
TypePermission
public class NoPermission extends java.lang.Object implements TypePermission
Wrapper to negate another type permission.If the wrapped
TypePermissionallows the type, this instance will throw aForbiddenClassExceptioninstead. An instance of this permission cannot be used to allow a type.- Since:
- 1.4.7
-
-
Field Summary
Fields Modifier and Type Field Description private TypePermissionpermission
-
Constructor Summary
Constructors Constructor Description NoPermission(TypePermission permission)Construct a NoPermission.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallows(java.lang.Class type)Check permission for a provided type.
-
-
-
Field Detail
-
permission
private final TypePermission permission
-
-
Constructor Detail
-
NoPermission
public NoPermission(TypePermission permission)
Construct a NoPermission.- Parameters:
permission- the permission to negate ornullto forbid any type- Since:
- 1.4.7
-
-
Method Detail
-
allows
public boolean allows(java.lang.Class type)
Description copied from interface:TypePermissionCheck permission for a provided type.- Specified by:
allowsin interfaceTypePermission- Parameters:
type- the type to check- Returns:
trueif provided type is allowed,falseif permission does not handle the type
-
-