Class SandboxMethodPointer
- All Implemented Interfaces:
SandboxCode,groovy.lang.GroovyCallable<Object>,groovy.lang.GroovyObject,Serializable,Cloneable,Runnable,Callable<Object>
obj.&name, obj::name, Type::new).
Its owner is validated when it is created (see GroovySandbox.methodPointer(Object)),
but the receiver of its calls is not always the owner: when the owner is a class, Groovy calls an
instance method of that class on the first argument (String::toUpperCase applied to
'a'). That argument is then validated as the receiver, as a direct call on it would be.
The calls are delegated to the MethodClosure created by Groovy, so they are resolved
exactly as Groovy does. It is kept in a SandboxMethodPointer.Target, a class the policy does not allow: Groovy
reads private fields, and the method closure itself must not be called without this check (e.g.
by passing it to each). As a SandboxClosure, the pointer is sandboxed code, also
when trusted code calls it later.
- See Also:
-
Field Summary
Fields inherited from class groovy.lang.Closure
DELEGATE_FIRST, DELEGATE_ONLY, DONE, IDENTITY, maximumNumberOfParameters, OWNER_FIRST, OWNER_ONLY, parameterTypes, SKIP, TO_SELF -
Method Summary
Methods inherited from class com.axelor.script.SandboxClosure
andThen, andThenSelf, andThenSelf, compose, composeSelf, composeSelf, curry, curry, leftShift, memoize, memoizeAtLeast, memoizeAtMost, memoizeBetween, ncurry, ncurry, rcurry, rcurry, rehydrate, rightShift, setDelegate, trampoline, trampolineMethods inherited from class groovy.lang.Closure
asWritable, call, call, call, clone, dehydrate, getDelegate, getDirective, getMaximumNumberOfParameters, getOwner, getParameterTypes, getResolveStrategy, getThisObject, isCase, leftShift, run, setDirective, setProperty, setResolveStrategy, throwRuntimeExceptionMethods inherited from class groovy.lang.GroovyObjectSupport
getMetaClass, setMetaClassMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface groovy.lang.GroovyObject
invokeMethod
-
Method Details
-
getMethod
The name of the method, ornewfor a constructor. -
getProperty
- Specified by:
getPropertyin interfacegroovy.lang.GroovyObject- Overrides:
getPropertyin classSandboxClosure<Object>
-
doCall
-