Class JexlSandbox.Permissions
- java.lang.Object
-
- org.apache.commons.jexl3.introspection.JexlSandbox.Permissions
-
- Enclosing class:
- JexlSandbox
public static final class JexlSandbox.Permissions extends java.lang.ObjectContains the allow or block lists for properties and methods for a given class.
-
-
Field Summary
Fields Modifier and Type Field Description private JexlSandbox.NamesexecuteThe controlled methods.private booleaninheritableWhether these permissions are inheritable, ie can be used by derived classes.private JexlSandbox.NamesreadThe controlled readable properties.private JexlSandbox.NameswriteThe controlled writable properties.
-
Constructor Summary
Constructors Constructor Description Permissions(boolean inherit, boolean readFlag, boolean writeFlag, boolean executeFlag)Creates a new permissions instance.Permissions(boolean inherit, JexlSandbox.Names nread, JexlSandbox.Names nwrite, JexlSandbox.Names nexecute)Creates a new permissions instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) JexlSandbox.Permissionscopy()JexlSandbox.Namesexecute()Gets the set of method names in these permissions.JexlSandbox.Permissionsexecute(java.lang.String... methodNames)Adds a list of executable methods names to these permissions.booleanisInheritable()Do these permissions apply to derived classes?JexlSandbox.Namesread()Gets the set of readable property names in these permissions.JexlSandbox.Permissionsread(java.lang.String... propertyNames)Adds a list of readable property names to these permissions.JexlSandbox.Nameswrite()Gets the set of writable property names in these permissions.JexlSandbox.Permissionswrite(java.lang.String... propertyNames)Adds a list of writable property names to these permissions.
-
-
-
Field Detail
-
inheritable
private final boolean inheritable
Whether these permissions are inheritable, ie can be used by derived classes.
-
read
private final JexlSandbox.Names read
The controlled readable properties.
-
write
private final JexlSandbox.Names write
The controlled writable properties.
-
execute
private final JexlSandbox.Names execute
The controlled methods.
-
-
Constructor Detail
-
Permissions
Permissions(boolean inherit, boolean readFlag, boolean writeFlag, boolean executeFlag)Creates a new permissions instance.- Parameters:
inherit- whether these permissions are inheritablereadFlag- whether the read property list is allow or blockwriteFlag- whether the write property list is allow or blockexecuteFlag- whether the method list is allow of block
-
Permissions
Permissions(boolean inherit, JexlSandbox.Names nread, JexlSandbox.Names nwrite, JexlSandbox.Names nexecute)Creates a new permissions instance.- Parameters:
inherit- whether these permissions are inheritablenread- the read setnwrite- the write setnexecute- the method set
-
-
Method Detail
-
copy
JexlSandbox.Permissions copy()
- Returns:
- a copy of these permissions
-
execute
public JexlSandbox.Names execute()
Gets the set of method names in these permissions.- Returns:
- the set of method names
-
execute
public JexlSandbox.Permissions execute(java.lang.String... methodNames)
Adds a list of executable methods names to these permissions.The constructor is denoted as the empty-string, all other methods by their names.
- Parameters:
methodNames- the method names- Returns:
thisinstance of permissions
-
isInheritable
public boolean isInheritable()
Do these permissions apply to derived classes?- Returns:
- whether these permissions apply to derived classes.
-
read
public JexlSandbox.Names read()
Gets the set of readable property names in these permissions.- Returns:
- the set of property names
-
read
public JexlSandbox.Permissions read(java.lang.String... propertyNames)
Adds a list of readable property names to these permissions.- Parameters:
propertyNames- the property names- Returns:
thisinstance of permissions
-
write
public JexlSandbox.Names write()
Gets the set of writable property names in these permissions.- Returns:
- the set of property names
-
write
public JexlSandbox.Permissions write(java.lang.String... propertyNames)
Adds a list of writable property names to these permissions.- Parameters:
propertyNames- the property names- Returns:
thisinstance of permissions
-
-