Package com.axelor.script
Class SandboxClosureWrapper<V>
java.lang.Object
groovy.lang.GroovyObjectSupport
groovy.lang.Closure<V>
com.axelor.script.SandboxClosure<V>
com.axelor.script.SandboxClosureWrapper<V>
- All Implemented Interfaces:
SandboxCode,groovy.lang.GroovyCallable<V>,groovy.lang.GroovyObject,Serializable,Cloneable,Runnable,Callable<V>
A closure Groovy builds from a sandboxed closure (
curry, >>, memoize,
trampoline...), see SandboxClosure.
The closures Groovy builds are not sandboxed: their delegate and owner can be set to anything
(c.memoize() then c.delegate = System, or rehydrate(System, ...)), and
their properties and calls without a receiver are resolved on them. They are wrapped in this
class, whose delegate and owner are validated as those of any SandboxClosure.
The calls are delegated to the closure built by Groovy, kept in a SandboxClosureWrapper.Target, a class the
policy does not allow, as SandboxMethodPointer does.
- 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
Modifier and TypeMethodDescriptionclone()voidsetDelegate(Object delegate) voidsetResolveStrategy(int resolveStrategy) groovy.lang.Closure<V> groovy.lang.Closure<V> trampoline(Object... arguments) Methods inherited from class com.axelor.script.SandboxClosure
andThen, andThenSelf, andThenSelf, compose, composeSelf, composeSelf, curry, curry, getProperty, leftShift, memoize, memoizeAtLeast, memoizeAtMost, memoizeBetween, ncurry, ncurry, rcurry, rcurry, rehydrate, rightShiftMethods inherited from class groovy.lang.Closure
asWritable, call, call, dehydrate, getDelegate, getDirective, getMaximumNumberOfParameters, getOwner, getParameterTypes, getResolveStrategy, getThisObject, isCase, leftShift, run, setDirective, setProperty, 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
-
clone
- Overrides:
clonein classgroovy.lang.Closure<V>
-
setDelegate
- Overrides:
setDelegatein classSandboxClosure<V>
-
setResolveStrategy
public void setResolveStrategy(int resolveStrategy) - Overrides:
setResolveStrategyin classgroovy.lang.Closure<V>
-
trampoline
- Overrides:
trampolinein classSandboxClosure<V>
-
trampoline
- Overrides:
trampolinein classSandboxClosure<V>
-
doCall
-
call
- Overrides:
callin classgroovy.lang.Closure<V>
-