Class JexlPermissions.LoggingPermissions
- All Implemented Interfaces:
JexlPermissions
- Enclosing interface:
JexlPermissions
This is a debugging aid to determine which reflective elements (classes, constructors, methods, fields)
a permission set allows or denies; wrap any permissions with JexlPermissions.logging() (or
JexlPermissions.logging(String) to pick the logger name) and inspect the log to diagnose why a
given object is or is not reachable from scripts.
- Since:
- 3.7.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.commons.jexl3.introspection.JexlPermissions
JexlPermissions.ClassPermissions, JexlPermissions.Delegate, JexlPermissions.LoggingPermissions -
Field Summary
Fields inherited from class org.apache.commons.jexl3.introspection.JexlPermissions.Delegate
baseFields inherited from interface org.apache.commons.jexl3.introspection.JexlPermissions
NONE, RESTRICTED, SECURE, UNRESTRICTED -
Constructor Summary
ConstructorsModifierConstructorDescriptionLoggingPermissions(String loggerName, JexlPermissions delegate) Constructs an instance logging to a named logger.LoggingPermissions(JexlPermissions delegate) Constructs an instance logging to a logger named after this class.protectedLoggingPermissions(org.apache.commons.logging.Log log, JexlPermissions delegate) Constructs an instance with an explicit logger. -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether a class allows JEXL introspection.booleanChecks whether a field explicitly allows JEXL introspection.booleanChecks whether a method allows JEXL introspection.booleanallow(Constructor<?> ctor) Checks whether a constructor allows JEXL introspection.booleanChecks whether a field explicitly allows JEXL introspection.booleanChecks whether a method allows JEXL introspection.Compose these permissions with a new set.Methods inherited from class org.apache.commons.jexl3.introspection.JexlPermissions.Delegate
allow
-
Constructor Details
-
LoggingPermissions
Constructs an instance logging to a logger named after this class.- Parameters:
delegate- the permissions to delegate to
-
LoggingPermissions
Constructs an instance logging to a named logger.- Parameters:
loggerName- the name of the logger to usedelegate- the permissions to delegate to
-
LoggingPermissions
Constructs an instance with an explicit logger.- Parameters:
log- the loggerdelegate- the permissions to delegate to
-
-
Method Details
-
allow
Description copied from interface:JexlPermissionsChecks whether a class allows JEXL introspection.If the class disallows JEXL introspection, none of its constructors, methods or fields as well as derived classes are visible to JEXL and cannot 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.
- Specified by:
allowin interfaceJexlPermissions- Overrides:
allowin classJexlPermissions.Delegate- Parameters:
clazz- the class to check- Returns:
- true if JEXL is allowed to introspect, false otherwise
-
allow
Description copied from interface:JexlPermissionsChecks whether a constructor allows JEXL introspection.If a constructor is not allowed, the new operator cannot be used to instantiate its declared class in scripts or expressions.
- Specified by:
allowin interfaceJexlPermissions- Overrides:
allowin classJexlPermissions.Delegate- Parameters:
ctor- the constructor to check- Returns:
- true if JEXL is allowed to introspect, false otherwise
-
allow
Description copied from interface:JexlPermissionsChecks whether a field explicitly allows JEXL introspection.If a field is not allowed, it cannot be resolved and accessed in scripts or expressions.
- Specified by:
allowin interfaceJexlPermissions- Overrides:
allowin classJexlPermissions.Delegate- Parameters:
field- the field to check- Returns:
- true if JEXL is allowed to introspect, false otherwise
-
allow
Description copied from interface:JexlPermissionsChecks whether a field explicitly allows JEXL introspection.If a field is not allowed, it cannot be resolved and accessed in scripts or expressions.
- Specified by:
allowin interfaceJexlPermissions- Overrides:
allowin classJexlPermissions.Delegate- Parameters:
clazz- the class from which the field is accessed, used to check that the field is allowed for this classfield- the field to check- Returns:
- true if JEXL is allowed to introspect, false otherwise
-
allow
Description copied from interface:JexlPermissionsChecks whether a method allows JEXL introspection.If a method is not allowed, it cannot be 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 method.
- Specified by:
allowin interfaceJexlPermissions- Overrides:
allowin classJexlPermissions.Delegate- Parameters:
method- the method to check- Returns:
- true if JEXL is allowed to introspect, false otherwise
-
allow
Description copied from interface:JexlPermissionsChecks whether a method allows JEXL introspection.If a method is not allowed, it cannot be resolved and called in scripts or expressions.
Since methods can be overridden and overloaded, this checks that this class explicitly allows this method - superseding any superclass or interface specified permissions.
- Specified by:
allowin interfaceJexlPermissions- Overrides:
allowin classJexlPermissions.Delegate- Parameters:
clazz- the class from which the method is accessed, used to check that the method is allowed for this classmethod- the method to check- Returns:
- true if JEXL is allowed to introspect, false otherwise
-
compose
Description copied from interface:JexlPermissionsCompose these permissions with a new set.This 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.*")- Specified by:
composein interfaceJexlPermissions- Overrides:
composein classJexlPermissions.Delegate- Parameters:
src- the new constraints- Returns:
- the new permissions
-