public class Checker extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Checker.SuperConstructorWrapper |
| Constructor and Description |
|---|
Checker() |
| Modifier and Type | Method and Description |
|---|---|
static Object |
checkedBinaryOp(Object lhs,
int op,
Object rhs)
Intercepts the binary expression of the form
lhs op rhs like lhs+rhs, lhs>>rhs, etc. |
static Object |
checkedCall(Object _receiver,
boolean safe,
boolean spread,
String _method,
Object[] _args) |
static Object |
checkedCast(Class<?> clazz,
Object exp,
boolean ignoreAutoboxing,
boolean coerce,
boolean strict)
Runs
ScriptBytecodeAdapter.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 Object |
checkedComparison(Object lhs,
int op,
Object rhs)
A compare method that invokes a.equals(b) or a.compareTo(b)==0
|
static Object |
checkedConstructor(Class _type,
Object[] _args) |
static Object |
checkedGetArray(Object _receiver,
Object _index) |
static Object |
checkedGetAttribute(Object _receiver,
boolean safe,
boolean spread,
Object _property) |
static Object |
checkedGetProperty(Object _receiver,
boolean safe,
boolean spread,
Object _property) |
static Object |
checkedPostfixArray(Object r,
Object i,
String op)
a[i]++ / a[i]--
|
static Object |
checkedPostfixProperty(Object receiver,
Object property,
boolean safe,
boolean spread,
String op)
a.x++ / a.x--
|
static Object |
checkedPrefixArray(Object r,
Object i,
String op)
++a[i] / --a[i]
|
static Object |
checkedPrefixProperty(Object receiver,
Object property,
boolean safe,
boolean spread,
String op)
++a.x / --a.x
|
static Object |
checkedSetArray(Object _receiver,
Object _index,
int op,
Object _value)
Intercepts the array assignment of the form "receiver[index] = value"
|
static Object |
checkedSetAttribute(Object _receiver,
Object _property,
boolean safe,
boolean spread,
int op,
Object _value)
Intercepts the attribute assignment of the form "receiver.@property = value"
|
static Object |
checkedSetProperty(Object _receiver,
Object _property,
boolean safe,
boolean spread,
int op,
Object _value) |
static Object |
checkedStaticCall(Class _receiver,
String _method,
Object[] _args) |
static Object |
checkedSuperCall(Class _senderType,
Object _receiver,
String _method,
Object[] _args) |
static Checker.SuperConstructorWrapper |
checkedSuperConstructor(Class<?> superClass,
Object[] args) |
public static Object checkedCall(Object _receiver, boolean safe, boolean spread, String _method, Object[] _args) throws Throwable
Throwablepublic static Object checkedStaticCall(Class _receiver, String _method, Object[] _args) throws Throwable
Throwablepublic static Object checkedConstructor(Class _type, Object[] _args) throws Throwable
Throwablepublic static Object checkedSuperCall(Class _senderType, Object _receiver, String _method, Object[] _args) throws Throwable
Throwablepublic static Checker.SuperConstructorWrapper checkedSuperConstructor(Class<?> superClass, Object[] args) throws Throwable
Throwablepublic static Object checkedGetProperty(Object _receiver, boolean safe, boolean spread, Object _property) throws Throwable
Throwablepublic static Object checkedSetProperty(Object _receiver, Object _property, boolean safe, boolean spread, int op, Object _value) throws Throwable
Throwablepublic static Object checkedGetAttribute(Object _receiver, boolean safe, boolean spread, Object _property) throws Throwable
Throwablepublic static Object checkedSetAttribute(Object _receiver, Object _property, boolean safe, boolean spread, int op, Object _value) throws Throwable
op - One of the assignment operators of TypesThrowablepublic static Object checkedGetArray(Object _receiver, Object _index) throws Throwable
Throwablepublic static Object checkedSetArray(Object _receiver, Object _index, int op, Object _value) throws Throwable
op - One of the assignment operators of TypesThrowablepublic static Object checkedPostfixArray(Object r, Object i, String op) throws Throwable
op - "next" for ++, "previous" for --. These names are defined by Groovy.Throwablepublic static Object checkedPrefixArray(Object r, Object i, String op) throws Throwable
Throwablepublic static Object checkedPostfixProperty(Object receiver, Object property, boolean safe, boolean spread, String op) throws Throwable
Throwablepublic static Object checkedPrefixProperty(Object receiver, Object property, boolean safe, boolean spread, String op) throws Throwable
Throwablepublic static Object checkedBinaryOp(Object lhs, int op, Object rhs) throws Throwable
lhs op rhs like lhs+rhs, lhs>>rhs, etc.
In Groovy, binary operators are method calls.op - One of the binary operators of TypesThrowableBinaryExpressionHelper.evaluateBinaryExpressionWithAssignment(java.lang.String, org.codehaus.groovy.ast.expr.BinaryExpression)public static Object checkedComparison(Object lhs, int op, Object rhs) throws Throwable
Throwablepublic static Object checkedCast(Class<?> clazz, Object exp, boolean ignoreAutoboxing, boolean coerce, boolean strict) throws Throwable
ScriptBytecodeAdapter.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 run receiver.method1(null, false) and receiver.method2(0, null) if methods with matching signatures were defined in the interfaces.Copyright © 2017. All rights reserved.