Package org.kohsuke.groovy.sandbox.impl
Class Checker
java.lang.Object
org.kohsuke.groovy.sandbox.impl.Checker
Intercepted Groovy script calls into this class.
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic interface -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectcheckedBinaryOp(Object lhs, int op, Object rhs) Intercepts the binary expression of the formlhs op rhslikelhs+rhs,lhs>>rhs, etc.static ObjectcheckedCall(Object _receiver, boolean safe, boolean spread, String _method, Object[] _args) static ObjectcheckedCast(Class<?> clazz, Object exp, boolean ignoreAutoboxing, boolean coerce, boolean strict) RunsScriptBytecodeAdapter.asType(java.lang.Object, java.lang.Class)but only after giving interceptors the chance to reject any possible interface methods as applied to the receiver.static ObjectcheckedComparison(Object lhs, int op, Object rhs) A compare method that invokes a.equals(b) or a.compareTo(b)==0static ObjectcheckedConstructor(Class _type, Object[] _args) static ObjectcheckedGetArray(Object _receiver, Object _index) static ObjectcheckedGetAttribute(Object _receiver, boolean safe, boolean spread, Object _property) static ObjectcheckedGetProperty(Object _receiver, boolean safe, boolean spread, Object _property) static ObjectcheckedPostfixArray(Object r, Object i, String op) a[i]++ / a[i]--static ObjectcheckedPostfixProperty(Object receiver, Object property, boolean safe, boolean spread, String op) a.x++ / a.x--static ObjectcheckedPrefixArray(Object r, Object i, String op) ++a[i] / --a[i]static ObjectcheckedPrefixProperty(Object receiver, Object property, boolean safe, boolean spread, String op) ++a.x / --a.xstatic ObjectcheckedSetArray(Object _receiver, Object _index, int op, Object _value) Intercepts the array assignment of the form "receiver[index] = value"static ObjectcheckedSetAttribute(Object _receiver, Object _property, boolean safe, boolean spread, int op, Object _value) Intercepts the attribute assignment of the form "receiver.@property = value"static ObjectcheckedSetProperty(Object _receiver, Object _property, boolean safe, boolean spread, int op, Object _value) static ObjectcheckedStaticCall(Class _receiver, String _method, Object[] _args) static ObjectcheckedSuperCall(Class _senderType, Object _receiver, String _method, Object[] _args) checkedSuperConstructor(Class<?> thisClass, Class<?> superClass, Object[] superCallArgs, Object[] constructorArgs, Class<?>[] constructorParamTypes) checkedThisConstructor(Class<?> clazz, Object[] thisCallArgs, Object[] constructorArgs, Class<?>[] constructorParamTypes) static Checker.ThunkpreCheckedCast(Class<?> clazz, Object exp, boolean ignoreAutoboxing, boolean coerce, boolean strict)
-
Constructor Details
-
Checker
public Checker()
-
-
Method Details
-
checkedCall
public static Object checkedCall(Object _receiver, boolean safe, boolean spread, String _method, Object[] _args) throws Throwable - Throws:
Throwable
-
checkedStaticCall
public static Object checkedStaticCall(Class _receiver, String _method, Object[] _args) throws Throwable - Throws:
Throwable
-
checkedConstructor
- Throws:
Throwable
-
checkedSuperCall
public static Object checkedSuperCall(Class _senderType, Object _receiver, String _method, Object[] _args) throws Throwable - Throws:
Throwable
-
checkedSuperConstructor
public static Checker.SuperConstructorWrapper checkedSuperConstructor(Class<?> thisClass, Class<?> superClass, Object[] superCallArgs, Object[] constructorArgs, Class<?>[] constructorParamTypes) throws Throwable - Throws:
Throwable
-
checkedThisConstructor
public static Checker.ThisConstructorWrapper checkedThisConstructor(Class<?> clazz, Object[] thisCallArgs, Object[] constructorArgs, Class<?>[] constructorParamTypes) throws Throwable - Throws:
Throwable
-
checkedGetProperty
public static Object checkedGetProperty(Object _receiver, boolean safe, boolean spread, Object _property) throws Throwable - Throws:
Throwable
-
checkedSetProperty
public static Object checkedSetProperty(Object _receiver, Object _property, boolean safe, boolean spread, int op, Object _value) throws Throwable - Throws:
Throwable
-
checkedGetAttribute
public static Object checkedGetAttribute(Object _receiver, boolean safe, boolean spread, Object _property) throws Throwable - Throws:
Throwable
-
checkedSetAttribute
public static Object checkedSetAttribute(Object _receiver, Object _property, boolean safe, boolean spread, int op, Object _value) throws Throwable Intercepts the attribute assignment of the form "receiver.@property = value"- Parameters:
op- One of the assignment operators ofTypes- Throws:
Throwable
-
checkedGetArray
- Throws:
Throwable
-
checkedSetArray
public static Object checkedSetArray(Object _receiver, Object _index, int op, Object _value) throws Throwable Intercepts the array assignment of the form "receiver[index] = value"- Parameters:
op- One of the assignment operators ofTypes- Throws:
Throwable
-
checkedPostfixArray
a[i]++ / a[i]--- Parameters:
op- "next" for ++, "previous" for --. These names are defined by Groovy.- Throws:
Throwable
-
checkedPrefixArray
++a[i] / --a[i]- Throws:
Throwable
-
checkedPostfixProperty
public static Object checkedPostfixProperty(Object receiver, Object property, boolean safe, boolean spread, String op) throws Throwable a.x++ / a.x--- Throws:
Throwable
-
checkedPrefixProperty
public static Object checkedPrefixProperty(Object receiver, Object property, boolean safe, boolean spread, String op) throws Throwable ++a.x / --a.x- Throws:
Throwable
-
checkedBinaryOp
Intercepts the binary expression of the formlhs op rhslikelhs+rhs,lhs>>rhs, etc. In Groovy, binary operators are method calls.- Parameters:
op- One of the binary operators ofTypes- Throws:
Throwable- See Also:
-
BinaryExpressionHelper.evaluateBinaryExpressionWithAssignment(java.lang.String, org.codehaus.groovy.ast.expr.BinaryExpression)
-
checkedComparison
A compare method that invokes a.equals(b) or a.compareTo(b)==0- Throws:
Throwable
-
checkedCast
public static Object checkedCast(Class<?> clazz, Object exp, boolean ignoreAutoboxing, boolean coerce, boolean strict) throws Throwable RunsScriptBytecodeAdapter.asType(java.lang.Object, java.lang.Class)but only after giving interceptors the chance to reject any possible interface methods as applied to the receiver. For example, might runreceiver.method1(null, false)andreceiver.method2(0, null)if methods with matching signatures were defined in the interfaces. -
preCheckedCast
public static Checker.Thunk preCheckedCast(Class<?> clazz, Object exp, boolean ignoreAutoboxing, boolean coerce, boolean strict) throws Throwable - Throws:
Throwable
-