public static class JexlPermissions.Delegate extends Object implements JexlPermissions
JexlPermissions.ClassPermissions, JexlPermissions.Delegate| Modifier and Type | Field and Description |
|---|---|
protected JexlPermissions |
base
The permissions we delegate to.
|
RESTRICTED, UNRESTRICTED| Modifier | Constructor and Description |
|---|---|
protected |
Delegate(JexlPermissions delegate) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allow(Class<?> clazz)
Checks whether a class allows JEXL introspection.
|
boolean |
allow(Constructor<?> ctor)
Checks whether a constructor allows JEXL introspection.
|
boolean |
allow(Field field)
Checks whether a field explicitly disallows JEXL introspection.
|
boolean |
allow(Method method)
Checks whether a method allows JEXL introspection.
|
boolean |
allow(Package pack)
Checks whether a package allows JEXL introspection.
|
JexlPermissions |
compose(String... src)
Compose these permissions with a new set.
|
protected final JexlPermissions base
protected Delegate(JexlPermissions delegate)
public boolean allow(Package pack)
JexlPermissionsIf the package disallows JEXL introspection, none of its classes or interfaces are visible to JEXL and can not be used in scripts or expression.
allow in interface JexlPermissionspack - the packagepublic boolean allow(Class<?> clazz)
JexlPermissionsIf the class disallows JEXL introspection, none of its constructors, methods or fields as well as derived classes are visible to JEXL and can not be used in scripts or expressions. If one of its super-classes is not allowed, tbe class is not allowed either.
For interfaces, only methods and fields are disallowed in derived interfaces or implementing classes.
allow in interface JexlPermissionsclazz - the class to checkpublic boolean allow(Constructor<?> ctor)
JexlPermissionsIf a constructor is not allowed, the new operator can not be used to instantiate its declared class in scripts or expressions.
allow in interface JexlPermissionsctor - the constructor to checkpublic boolean allow(Method method)
JexlPermissionsIf a method is not allowed, it can not resolved and called in scripts or expressions.
Since methods can be overridden and overloaded, this also checks that no superclass or interface explicitly disallows this methods.
allow in interface JexlPermissionsmethod - the method to checkpublic boolean allow(Field field)
JexlPermissionsIf a field is not allowed, it can not resolved and accessed in scripts or expressions.
allow in interface JexlPermissionsfield - the field to checkpublic JexlPermissions compose(String... src)
JexlPermissionsThis is a convenience method meant to easily give access to the packages JEXL is
used to integrate with. For instance, using
would extend the restricted set of permissions by allowing the com.my.app package.JexlPermissions.RESTRICTED.compose("com.my.app.*")
compose in interface JexlPermissionssrc - the new constraintsCopyright © 2001–2022 The Apache Software Foundation. All rights reserved.