| Modifiers | Name | Description |
|---|---|---|
static Object[] |
EMPTY_ARGS |
An empty Object array constant. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public static Object |
asType(Object object, Class type)Provides a hook for type coercion of the given object to the required type |
|
public static void |
assertFailed(Object expression, Object message)Signals a failed assertion by calling InvokerHelper.assertFailed. |
|
public static Object |
bitwiseNegate(Object value)Returns the bitwise negation of value from InvokerHelper.bitwiseNegate.
|
|
public static Object |
castToType(Object object, Class type)Provides a hook for type casting of the given object to the required type |
|
public static boolean |
compareEqual(Object left, Object right)Compares left and right for equality. |
|
public static boolean |
compareGreaterThan(Object left, Object right)Reports whether left is greater than right. |
|
public static boolean |
compareGreaterThanEqual(Object left, Object right)Reports whether left is greater than or equal to right. |
|
public static boolean |
compareIdentical(Object left, Object right)Reports whether left and right are the same reference, using
left == right. |
|
public static boolean |
compareLessThan(Object left, Object right)Reports whether left is less than right. |
|
public static boolean |
compareLessThanEqual(Object left, Object right)Reports whether left is less than or equal to right. |
|
public static boolean |
compareNotEqual(Object left, Object right)Returns the negation of compareEqual(Object, Object). |
|
public static boolean |
compareNotIdentical(Object left, Object right)Reports whether left and right are different references, using
{@code left ! |
|
public static Integer |
compareTo(Object left, Object right)Compares left with right and returns a boxed -1, 0, or
1. |
|
public static Object |
compoundAssign(Object receiver, Object arg, String assignName, String baseName)GEP-15: dispatcher for compound-assignment operators in dynamic Groovy. |
|
public static Wrapper |
createGroovyObjectWrapper(GroovyObject val, Class clazz)Wraps val in a GroovyObjectWrapper constrained to clazz. |
|
public static List |
createList(Object[] values)Creates a List containing values in order by calling
InvokerHelper.createList. |
|
public static Map |
createMap(Object[] values)Creates a Map from values by calling InvokerHelper.createMap.
|
|
public static Wrapper |
createPojoWrapper(Object val, Class clazz)Wraps a plain value in a PojoWrapper constrained to clazz. |
|
public static List |
createRange(Object from, Object to, boolean exclusiveLeft, boolean exclusiveRight)Builds a range from from to to, honoring exclusive ends. |
|
public static List |
createRange(Object from, Object to, boolean inclusive)Builds a range from from to to with from included. |
|
public static Tuple |
createTuple(Object[] array)Returns a Tuple constructed from the elements of array. |
|
public static Object[] |
despreadList(Object[] args, Object[] spreads, int[] positions)Spreads selected argument values into one flat argument array. |
|
public static Matcher |
findRegex(Object left, Object right)Returns a Matcher of left against the regular expression right, by
calling InvokerHelper.findRegex. |
|
public static Object |
getField(Class senderClass, Object receiver, String messageName)Reads the field named messageName by calling InvokerHelper.getAttribute.
|
|
public static Object |
getFieldOnSuper(Class senderClass, Object receiver, String messageName)Reads the field named messageName, using the super-class attribute unless
receiver is a Class. |
|
public static Object |
getFieldOnSuperSafe(Class senderClass, Object receiver, String messageName)Forwards to getFieldOnSuper with the same arguments. |
|
public static Object |
getFieldOnSuperSpreadSafe(Class senderClass, Object receiver, String messageName)Reads the field named messageName from each element of receiver.
|
|
public static Object |
getFieldSafe(Class senderClass, Object receiver, String messageName)Reads the field named messageName, returning null when receiver is null. |
|
public static Object |
getFieldSpreadSafe(Class senderClass, Object receiver, String messageName)Reads the field named messageName from each element of receiver. |
|
public static Object |
getGroovyObjectField(Class senderClass, GroovyObject receiver, String messageName)Reads the field named messageName from a GroovyObject through its
metaclass. |
|
public static Object |
getGroovyObjectFieldSafe(Class senderClass, GroovyObject receiver, String messageName)Reads the field named messageName, returning null when receiver is null. |
|
public static Object |
getGroovyObjectFieldSpreadSafe(Class senderClass, GroovyObject receiver, String messageName)Reads the field named messageName from each element of receiver. |
|
public static Object |
getGroovyObjectProperty(Class senderClass, GroovyObject receiver, String messageName)Reads messageName from a GroovyObject, falling back to the metaclass for a
superclass sender. |
|
public static Object |
getGroovyObjectPropertySafe(Class senderClass, GroovyObject receiver, String messageName)Reads messageName, returning null when receiver is null. |
|
public static Object |
getGroovyObjectPropertySpreadSafe(Class senderClass, GroovyObject receiver, String messageName)Reads the property named messageName from each element of receiver. |
|
public static Closure |
getMethodPointer(Object object, String methodName)Returns a method closure for the given object and name. |
|
public static Object |
getProperty(Class senderClass, Object receiver, String messageName)Reads the property named messageName from receiver. |
|
public static Object |
getPropertyOnSuper(Class senderClass, GroovyObject receiver, String messageName)Reads the property named messageName from the super class of a
GroovyObject. |
|
public static Object |
getPropertyOnSuperSafe(Class senderClass, GroovyObject receiver, String messageName)Forwards to getPropertyOnSuper with the same arguments. |
|
public static Object |
getPropertyOnSuperSpreadSafe(Class senderClass, GroovyObject receiver, String messageName)Reads the property named messageName from each element of receiver.
|
|
public static Object |
getPropertySafe(Class senderClass, Object receiver, String messageName)Reads the property named messageName, returning null when receiver is
null. |
|
public static Object |
getPropertySpreadSafe(Class senderClass, Object receiver, String messageName)Reads the property named messageName from each element of receiver. |
|
public static MetaClass |
initMetaClass(Object object)Returns the MetaClass registered for the class of object. |
|
public static Object |
invokeClosure(Object closure, Object[] arguments)Invokes call on closure. |
|
public static Object |
invokeMethod0(Class senderClass, Object receiver, String messageName)Invokes messageName with no arguments. |
|
public static Object |
invokeMethod0Safe(Class senderClass, Object receiver, String messageName)Invokes messageName with no arguments, returning null when receiver is
null. |
|
public static Object |
invokeMethod0SpreadSafe(Class senderClass, Object receiver, String messageName)Spread-invokes messageName with no arguments. |
|
public static Object |
invokeMethodN(Class senderClass, Object receiver, String messageName, Object[] messageArguments)Invokes messageName on receiver by calling
InvokerHelper.invokeMethod. |
|
public static Object |
invokeMethodNSafe(Class senderClass, Object receiver, String messageName, Object[] messageArguments)Invokes messageName on receiver, returning null when receiver is
null. |
|
public static Object |
invokeMethodNSpreadSafe(Class senderClass, Object receiver, String messageName, Object[] messageArguments)Invokes messageName on each element of receiver and returns the results. |
|
public static Object |
invokeMethodOnCurrent0(Class senderClass, GroovyObject receiver, String messageName)Invokes messageName with no arguments. |
|
public static Object |
invokeMethodOnCurrent0Safe(Class senderClass, GroovyObject receiver, String messageName, Object[] messageArguments)Invokes messageName with no arguments. |
|
public static Object |
invokeMethodOnCurrent0SpreadSafe(Class senderClass, GroovyObject receiver, String messageName, Object[] messageArguments)Spread-invokes messageName with no arguments. |
|
public static Object |
invokeMethodOnCurrentN(Class senderClass, GroovyObject receiver, String messageName, Object[] messageArguments)Invokes messageName on a GroovyObject from inside the receiver. |
|
public static Object |
invokeMethodOnCurrentNSafe(Class senderClass, GroovyObject receiver, String messageName, Object[] messageArguments)Forwards to invokeMethodOnCurrentN with the same arguments. |
|
public static Object |
invokeMethodOnCurrentNSpreadSafe(Class senderClass, GroovyObject receiver, String messageName, Object[] messageArguments)Invokes messageName on each element of receiver and returns the results.
|
|
public static Object |
invokeMethodOnSuper0(Class senderClass, GroovyObject receiver, String messageName)Invokes messageName on the super class with no arguments. |
|
public static Object |
invokeMethodOnSuper0Safe(Class senderClass, GroovyObject receiver, String messageName, Object[] messageArguments)Invokes messageName on the super class with no arguments. |
|
public static Object |
invokeMethodOnSuper0SpreadSafe(Class senderClass, GroovyObject receiver, String messageName, Object[] messageArguments)Spread-invokes messageName with no arguments. |
|
public static Object |
invokeMethodOnSuperN(Class senderClass, GroovyObject receiver, String messageName, Object[] messageArguments)Invokes messageName on the super class of a GroovyObject. |
|
public static Object |
invokeMethodOnSuperNSafe(Class senderClass, GroovyObject receiver, String messageName, Object[] messageArguments)Forwards to invokeMethodOnSuperN with the same arguments. |
|
public static Object |
invokeMethodOnSuperNSpreadSafe(Class senderClass, GroovyObject receiver, String messageName, Object[] messageArguments)Invokes messageName on each element of receiver and returns the results.
|
|
public static Object |
invokeNew0(Class senderClass, Class receiver)Constructs an instance of receiver with no arguments. |
|
public static Object |
invokeNewN(Class senderClass, Class receiver, Object arguments)Constructs an instance of receiver by calling
InvokerHelper.invokeConstructorOf. |
|
public static Object |
invokeStaticMethod0(Class senderClass, Class receiver, String messageName)Invokes the static method messageName with no arguments. |
|
public static Object |
invokeStaticMethodN(Class senderClass, Class receiver, String messageName, Object[] messageArguments)Invokes the static method messageName on receiver by calling
InvokerHelper.invokeStaticMethod. |
|
public static boolean |
isCase(Object switchValue, Object caseExpression)Tests whether caseExpression matches switchValue by calling
isCase. |
|
public static boolean |
isIn(Object switchValue, Object caseExpression)Tests whether switchValue is a member of caseExpression. |
|
public static boolean |
isNotCase(Object switchValue, Object caseExpression)Returns the negation of isCase(Object, Object). |
|
public static boolean |
isNotIn(Object switchValue, Object caseExpression)Returns the negation of isIn(Object, Object). |
|
public static boolean |
matchRegex(Object left, Object right)Reports whether left matches the whole regular expression right, by
calling InvokerHelper.matchRegex. |
|
public static Closure<?> |
packedClosure(Object owner, Object dispatchers, int id, String method, Object[] captured, Class[] paramTypes, boolean strict, boolean implicit, boolean vararg)GROOVY-12151: the bytecode-facing factory for the shared packed-closure adapter. |
|
public static Closure<?> |
packedClosure(Object owner, Object dispatchers, int id, String method, Object[] captured, Class[] paramTypes, boolean strict, boolean implicit, boolean vararg, boolean usesReceiver)The packed-closure factory the compiler emits: as packedClosure(Object, Object, int, String, Object[], Class[], boolean, boolean, boolean), which stays for class files compiled before it, plus whether the hoisted body uses its receiver, so rehydrate hands the copy's body a new this object wherever a
@CompileStatic closure class would use it. |
|
public static Pattern |
regexPattern(Object regex)Compiles regex into a Pattern. |
|
public static int |
selectConstructorAndTransformArguments(Object[] arguments, int numberOfConstructors, Class which)Selects a constructor of which and transforms arguments. |
|
public static void |
setField(Object messageArgument, Class senderClass, Object receiver, String messageName)Writes the field named messageName by calling InvokerHelper.setAttribute.
|
|
public static void |
setFieldOnSuper(Object messageArgument, Class senderClass, Object receiver, String messageName)Writes the field named messageName, using the super-class attribute unless
receiver is a Class. |
|
public static void |
setFieldOnSuperSafe(Object messageArgument, Class senderClass, Object receiver, String messageName)Forwards to setFieldOnSuper with the same arguments. |
|
public static void |
setFieldOnSuperSpreadSafe(Object messageArgument, Class senderClass, Object receiver, String messageName)Writes the field named messageName on each element of receiver.
|
|
public static void |
setFieldSafe(Object messageArgument, Class senderClass, Object receiver, String messageName)Writes the field named messageName, doing nothing when receiver is null. |
|
public static void |
setFieldSpreadSafe(Object messageArgument, Class senderClass, Object receiver, String messageName)Writes the field named messageName on each element of receiver. |
|
public static void |
setGroovyObjectField(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)Writes the field named messageName on a GroovyObject through its
metaclass. |
|
public static void |
setGroovyObjectFieldSafe(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)Writes the field named messageName, doing nothing when receiver is null. |
|
public static void |
setGroovyObjectFieldSpreadSafe(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)Writes the field named messageName on each element of receiver. |
|
public static void |
setGroovyObjectProperty(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)Writes messageName on a GroovyObject, using the object's own setter when
the sender requires it. |
|
public static void |
setGroovyObjectPropertySafe(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)Writes messageName on receiver, doing nothing when receiver is
null. |
|
public static void |
setGroovyObjectPropertySpreadSafe(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)Writes the property named messageName on each element of receiver. |
|
public static void |
setProperty(Object messageArgument, Class senderClass, Object receiver, String messageName)Writes messageArgument to the property named messageName. |
|
public static void |
setPropertyOnSuper(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)Writes the property named messageName on the super class of a
GroovyObject. |
|
public static void |
setPropertyOnSuperSafe(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)Forwards to setPropertyOnSuper with the same arguments. |
|
public static void |
setPropertyOnSuperSpreadSafe(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName)Writes the property named messageName on each element of receiver.
|
|
public static void |
setPropertySafe(Object messageArgument, Class senderClass, Object receiver, String messageName)Writes the property named messageName, doing nothing when receiver is
null. |
|
public static void |
setPropertySpreadSafe(Object messageArgument, Class senderClass, Object receiver, String messageName)Writes the property named messageName on each element of receiver. |
|
public static Object |
spreadMap(Object value)Spreads value as a map by calling InvokerHelper.spreadMap. |
|
public static Object |
unaryMinus(Object value)Returns the negation of value from InvokerHelper.unaryMinus.
|
|
public static Object |
unaryPlus(Object value)Returns the unary plus of value from InvokerHelper.unaryPlus.
|
|
public static Throwable |
unwrap(GroovyRuntimeException gre)Unwraps a GroovyRuntimeException, extracting the actual cause if present. |
An empty Object array constant.
Provides a hook for type coercion of the given object to the required type
type - of object to convert the given object toobject - the object to be converted Signals a failed assertion by calling InvokerHelper.assertFailed. A null or empty
message produces a PowerAssertionError from expression.toString(). Any
other message produces an AssertionError that includes the message and the
expression.
expression - the expression that failedmessage - the assertion message, or null or empty for a power assertion Returns the bitwise negation of value from InvokerHelper.bitwiseNegate.
Integer and Long use the ~ operator, and BigInteger uses
not(). A String or GString is compiled as a regular expression by
StringGroovyMethods.bitwiseNegate on value.toString(). An
ArrayList yields a new list of element-wise results. Any other value is sent the
no-argument message bitwiseNegate. A GroovyRuntimeException is passed to
unwrap and rethrown.
value - the value to negateProvides a hook for type casting of the given object to the required type
type - of object to convert the given object toobject - the object to be converted Compares left and right for equality.
The same reference is equal, including both null. When both values are non-null and have
the same class, Integer, Long, Double, Float,
String, and GStringImpl use equals, and BigDecimal and
BigInteger are equal when compareTo returns 0. Every other pair is
compared with DefaultTypeTransformation.compareEqual.
left - the left operandright - the right operand Reports whether left is greater than right.
When both values are non-null and have the same class, Integer, Long,
Double, and Float use the > operator, and BigDecimal and
BigInteger are greater when compareTo is positive. Every other pair is
greater when compareTo(Object, Object) returns 1.
left - the left operandright - the right operandleft is greater than right Reports whether left is greater than or equal to right.
When both values are non-null and have the same class, Integer, Long,
Double, and Float use the >= operator, and BigDecimal and
BigInteger are greater or equal when compareTo is not negative. Every
other pair is greater or equal when compareTo(Object, Object) returns 1
or 0.
left - the left operandright - the right operandleft is greater than or equal to right Reports whether left and right are the same reference, using
left == right.
left - the left operandright - the right operand Reports whether left is less than right.
When both values are non-null and have the same class, Integer, Long,
Double, and Float use the < operator, and BigDecimal and
BigInteger are less when compareTo is negative. Every other pair is less
when compareTo(Object, Object) returns -1.
left - the left operandright - the right operandleft is less than right Reports whether left is less than or equal to right.
When both values are non-null and have the same class, Integer, Long,
Double, and Float use the <= operator, and BigDecimal and
BigInteger are less or equal when compareTo is not positive. Every other
pair is less or equal when compareTo(Object, Object) returns -1 or
0.
left - the left operandright - the right operandleft is less than or equal to rightReturns the negation of compareEqual(Object, Object).
left - the left operandright - the right operand Reports whether left and right are different references, using
left != right.
left - the left operandright - the right operand Compares left with right and returns a boxed -1, 0, or
1. The comparison is DefaultTypeTransformation.compareTo.
A zero result is returned as 0, a positive result as 1, and a negative
result as -1.
left - the left operandright - the right operand-1 when left is less than right, 0 when they are
equal, and 1 when left is greater GEP-15: dispatcher for compound-assignment operators in dynamic Groovy.
If receiver responds to assignName with the supplied argument,
invoke it and return receiver (so the caller's STORE assigns the same
reference back, leaving the in-place mutation visible). Otherwise fall back to
baseName and return its result for the caller to assign.
Wraps val in a GroovyObjectWrapper constrained to clazz.
val - the wrapped GroovyObjectclazz - the type the wrapper reports Creates a List containing values in order by calling
InvokerHelper.createList.
values - the elements copied into the list Creates a Map from values by calling InvokerHelper.createMap.
Entries are taken as alternating keys and values, in pair order. A SpreadMap
followed by a Map contributes that map's entries. A trailing value left without a
pair is ignored.
values - alternating keys and values, with optional spread pairs Wraps a plain value in a PojoWrapper constrained to clazz.
val - the wrapped valueclazz - the type the wrapper reports Builds a range from from to to, honoring exclusive ends.
When both ends are exclusive, an EmptyRange at from is returned if
compareEqual considers the ends equal, or if stepping from from toward
to lands on to and the ends have the same sign. The step is next
when from is less than to and previous otherwise, invoked through
invokeMethod0 with this class as the sender. Sign comes from compareTo
against 0: both ends non-negative, or both negative. Zero counts as non-negative,
so a fully exclusive range from zero to a negative number is not emptied by this rule.
An equal pair with either end exclusive is also an
EmptyRange.
Otherwise, two Integer endpoints produce an IntRange whose inclusive flags
are the negations of exclusiveLeft and exclusiveRight. Two other
Number endpoints produce a NumberRange with those same inclusive flags.
Every other pair produces an ObjectRange. That type does not record inclusivity,
so an exclusive right endpoint is replaced by to.next() when from is
greater than to and by to.previous() otherwise, and then an exclusive left
endpoint is replaced by from.previous() when from is greater than the
updated to and by from.next() otherwise. Those calls also go through
invokeMethod0 with this class as the sender.
next or previous call fails; a
GroovyRuntimeException from that call is unwrappedfrom - the start of the rangeto - the end of the rangeexclusiveLeft - true when from is excludedexclusiveRight - true when to is excluded Builds a range from from to to with from included. The call is
createRange(Object, Object, boolean, boolean) with the left end inclusive and the
right end exclusive exactly when inclusive is false. Kept for compatibility with
callers of this overload.
from - the start of the range; this end is includedto - the end of the rangeinclusive - true when to is included Returns a Tuple constructed from the elements of array.
array - the elements passed to the Tuple constructorSpreads selected argument values into one flat argument array.
Each entry of positions is an index in args. Arguments from the current
index up to that position are copied, then the matching spreads value is expanded.
After the last position, any remaining arguments are appended. A spread value is tested in
this order: null is copied as null; a List is copied with addAll; an
Iterable has each element added; an Iterator is drained with
forEachRemaining; a BaseStream is drained through its iterator; an array
is boxed with DefaultTypeTransformation.primitiveArrayBox when its
component type is primitive, and otherwise copied as an object array. Any other value
throws IllegalArgumentException. The message names the runtime type and the value,
and a Map appends ", did you mean to use the spread-map operator instead?".
args - the arguments that are not spreadspreads - the values to expand, one per entry of positionspositions - indexes in args at which each spread value is inserted Returns a Matcher of left against the regular expression right, by
calling InvokerHelper.findRegex. A String left operand is used as that
string; any other left operand is rendered to a string. A Pattern right operand is
used as that pattern. A String right operand is compiled, and every other right
operand is compiled from its rendered text.
left - the text to searchright - the regular expression, as a Pattern, a string, or another value
rendered to a stringleft Reads the field named messageName by calling InvokerHelper.getAttribute.
The helper replaces a null receiver with NullObject. A
GroovyRuntimeException is passed to unwrap and rethrown.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the field name Reads the field named messageName, using the super-class attribute unless
receiver is a Class.
When receiver is a Class, the read is InvokerHelper.getAttribute.
Any other receiver is cast to GroovyObject and read with
MetaClass.getAttribute passing useSuper
true. A GroovyRuntimeException is passed to unwrap and rethrown.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the field name Forwards to getFieldOnSuper with the same arguments. A null receiver is
passed through on that call.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the field name Reads the field named messageName from each element of receiver.
InvokerHelper.asIterator walks receiver with no null test. Each element is
read with getFieldOnSuper, and the values are collected into a List.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the field name Reads the field named messageName, returning null when receiver is null. A
non-null receiver is read with getField.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the field namereceiver is null; otherwise the field value Reads the field named messageName from each element of receiver. A null
receiver returns null. Otherwise InvokerHelper.asIterator walks the receiver, each
element is read with getFieldSafe, and the values are collected into a
List.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the field namereceiver is null; otherwise a List of field values Reads the field named messageName from a GroovyObject through its
metaclass. MetaClass.getAttribute is called with
useSuper false. A GroovyRuntimeException is passed to unwrap and
rethrown.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the field name Reads the field named messageName, returning null when receiver is null. A
non-null receiver is read through its metaclass
MetaClass.getAttribute with useSuper
false. A GroovyRuntimeException is passed to unwrap and rethrown.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the field namereceiver is null; otherwise the field value Reads the field named messageName from each element of receiver. A null
receiver returns null. Otherwise InvokerHelper.asIterator walks the receiver, each
element is read with getFieldSafe, and the values are collected into a
List.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the field namereceiver is null; otherwise a List of field values Reads messageName from a GroovyObject, falling back to the metaclass for a
superclass sender.
GroovyObject.getProperty is called first. A
MissingPropertyException is passed to unwrap and rethrown when
senderClass is null, is the receiver's own class, or the receiver is not an
instance of senderClass. Any other GroovyRuntimeException is unwrapped and
rethrown. When the missing-property exception is not rethrown, the receiver's metaclass
MetaClass.getProperty is called with
isCallToSuper false and fromInsideClass false.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the property name Reads messageName, returning null when receiver is null. A non-null
receiver is read with getGroovyObjectProperty.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the property namereceiver is null; otherwise the property value Reads the property named messageName from each element of receiver. A null
receiver returns null. Otherwise InvokerHelper.asIterator walks the receiver, each
element is read with getPropertySafe, and the values are collected into a
List.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the property namereceiver is null; otherwise a List of property valuesReturns a method closure for the given object and name.
object - the object or class providing the methodmethodName - the method(s) of interest Reads the property named messageName from receiver.
A null receiver is read from NullObject.getNullObject(). A GroovyObject is
read with GroovyObject.getProperty when senderClass is null or
GroovyObjectOverrides.overridesGetProperty is true for the receiver's
class. That test is true for a getProperty other than the GroovyObject
default, including a synthetic or @Internal implementation, and when the method
cannot be inspected. Every other receiver is read through the metaclass from
InvokerHelper.getMetaClass, calling
MetaClass.getProperty with
isCallToSuper false and fromInsideClass false. A
GroovyRuntimeException is passed to unwrap and rethrown.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the property name Reads the property named messageName from the super class of a
GroovyObject. The receiver's metaclass
MetaClass.getProperty is called with
isCallToSuper true and fromInsideClass false. A
GroovyRuntimeException is passed to unwrap and rethrown.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the property name Forwards to getPropertyOnSuper with the same arguments. A null receiver
is passed through on that call.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the property name Reads the property named messageName from each element of receiver.
InvokerHelper.asIterator walks receiver with no null test. Each element is
read with getPropertySafe, and the values are collected into a List.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the property name Reads the property named messageName, returning null when receiver is
null. A non-null receiver is read with getProperty.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the property namereceiver is null; otherwise the property value Reads the property named messageName from each element of receiver. A null
receiver returns null. Otherwise InvokerHelper.asIterator walks the receiver, each
element is read with getPropertySafe, and the values are collected into a
List.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the property namereceiver is null; otherwise a List of property values Returns the MetaClass registered for the class of object. The lookup is
InvokerHelper.getMetaClass(object.getClass()).
object - the object whose class is looked upobject.getClass() Invokes call on closure. The call is invokeMethodN with the
closure's runtime class as the sender and with arguments passed through, so a
GroovyRuntimeException is unwrapped.
closure - the object whose call method is invokedarguments - the arguments passed to callcall Invokes messageName with no arguments. The call is invokeMethodN with
EMPTY_ARGS.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the method name Invokes messageName with no arguments, returning null when receiver is
null. A non-null receiver is forwarded to invokeMethodNSafe with
EMPTY_ARGS.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the method namereceiver is null; otherwise the result of
invokeMethodNSafe Spread-invokes messageName with no arguments. The call is
invokeMethodNSpreadSafe with EMPTY_ARGS.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the method name Invokes messageName on receiver by calling
InvokerHelper.invokeMethod. The helper replaces a null receiver with
NullObject. A receiver that is a Class is dispatched as a static call. A
GroovyRuntimeException is passed to unwrap and rethrown.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the method namemessageArguments - the arguments to passInvokerHelper.invokeMethod Invokes messageName on receiver, returning null when receiver is
null. A non-null receiver is forwarded to invokeMethodN.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the method namemessageArguments - the arguments to passreceiver is null; otherwise the result of invokeMethodN Invokes messageName on each element of receiver and returns the results. A
null receiver returns null. Otherwise InvokerHelper.asIterator walks the receiver,
each element is invoked with invokeMethodNSafe, and the results are collected
into a List.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the method namemessageArguments - the arguments to passreceiver is null; otherwise a List of per-element
results Invokes messageName with no arguments. The call is invokeMethodOnCurrentN
with EMPTY_ARGS.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the method name Invokes messageName with no arguments. messageArguments is ignored and
EMPTY_ARGS is passed to invokeMethodOnCurrentNSafe.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the method namemessageArguments - ignored; EMPTY_ARGS is passed instead Spread-invokes messageName with no arguments. messageArguments is ignored
and EMPTY_ARGS is passed to invokeMethodOnCurrentNSpreadSafe.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the method namemessageArguments - ignored; EMPTY_ARGS is passed instead Invokes messageName on a GroovyObject from inside the receiver.
A GroovyInterceptable receiver is dispatched with
GroovyObject.invokeMethod. Any other receiver is dispatched
through its metaclass
MetaClass.invokeMethod, with
isCallToSuper false and fromInsideClass true.
A MissingMethodExecutionFailed is rethrown as its MissingMethodException
cause and then unwrapped. Any other MissingMethodException whose type is the
receiver's class and whose method name equals messageName falls back to
GroovyObject.invokeMethod when the receiver is not intercepting. A
GroovyRuntimeException is passed to unwrap and rethrown.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the method namemessageArguments - the arguments to pass Forwards to invokeMethodOnCurrentN with the same arguments. A null
receiver is passed through on that call.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the method namemessageArguments - the arguments to pass Invokes messageName on each element of receiver and returns the results.
InvokerHelper.asIterator walks receiver with no null test. Each element is
invoked with invokeMethodNSafe, so a null element contributes null, and the
results are collected into a List.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the method namemessageArguments - the arguments to pass Invokes messageName on the super class with no arguments. The call is
invokeMethodOnSuperN with EMPTY_ARGS.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the method name Invokes messageName on the super class with no arguments. messageArguments
is ignored and EMPTY_ARGS is passed to invokeMethodOnSuperNSafe.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the method namemessageArguments - ignored; EMPTY_ARGS is passed instead Spread-invokes messageName with no arguments. messageArguments is ignored
and EMPTY_ARGS is passed to invokeMethodOnSuperNSpreadSafe.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the method namemessageArguments - ignored; EMPTY_ARGS is passed instead Invokes messageName on the super class of a GroovyObject.
The receiver's metaclass is called directly, with no GroovyInterceptable dispatch
and no missing-method fallback.
MetaClass.invokeMethod is
passed isCallToSuper true and fromInsideClass true. A
GroovyRuntimeException is passed to unwrap and rethrown.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the method namemessageArguments - the arguments to pass Forwards to invokeMethodOnSuperN with the same arguments. A null receiver
is passed through on that call.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the method namemessageArguments - the arguments to pass Invokes messageName on each element of receiver and returns the results.
InvokerHelper.asIterator walks receiver with no null test. Each element is
invoked with invokeMethodNSafe, so a null element contributes null, and the
results are collected into a List.
senderClass - the class that originated the callreceiver - the receiver of the callmessageName - the method namemessageArguments - the arguments to pass Constructs an instance of receiver with no arguments. The call is
invokeNewN with EMPTY_ARGS.
senderClass - the class that originated the callreceiver - the class to instantiate Constructs an instance of receiver by calling
InvokerHelper.invokeConstructorOf. The helper treats a null arguments
value as no arguments, passes an object array through, and wraps any other object as the
sole argument. A GroovyRuntimeException is passed to unwrap and rethrown.
senderClass - the class that originated the callreceiver - the class to instantiatearguments - the constructor arguments, as interpreted by
InvokerHelper.invokeConstructorOf Invokes the static method messageName with no arguments. The call is
invokeStaticMethodN with EMPTY_ARGS.
senderClass - the class that originated the callreceiver - the class that holds the static methodmessageName - the method name Invokes the static method messageName on receiver by calling
InvokerHelper.invokeStaticMethod. A GroovyRuntimeException is passed to
unwrap and rethrown.
senderClass - the class that originated the callreceiver - the class that holds the static methodmessageName - the method namemessageArguments - the arguments to pass Tests whether caseExpression matches switchValue by calling
isCase.
A null case expression matches only a null switch value. Otherwise invokeMethodN
calls isCase on the case expression with switchValue as its only argument,
and the result is converted with DefaultTypeTransformation.castToBoolean.
switchValue - the value being switched oncaseExpression - the case expression on which isCase is called, or null Tests whether switchValue is a member of caseExpression.
A null case expression matches only a null switch value. A Map matches when
Map.containsKey returns true for switchValue. When both operands are
character sequences, the case expression's string form is tested with contains for
the switch value's string form. Every other case expression is tested with
isCase(Object, Object).
switchValue - the candidate membercaseExpression - the collection, character sequence, or case expression being
searchedswitchValue is a member of caseExpressionReturns the negation of isCase(Object, Object).
switchValue - the value being switched oncaseExpression - the case passed to isCase(Object, Object)Returns the negation of isIn(Object, Object).
switchValue - the candidate membercaseExpression - the value passed to isIn(Object, Object) Reports whether left matches the whole regular expression right, by
calling InvokerHelper.matchRegex. A null operand yields false. A Pattern
right operand is used as that pattern; any other right operand is compiled from its string
form. The matcher is saved with RegexSupport.setLastMatcher, and the result is
Matcher.matches().
left - the text to matchright - the regular expression, or nullleft matches the entire pattern GROOVY-12151: the bytecode-facing factory for the shared packed-closure adapter. The compiler
emits one INVOKESTATIC of this method per packed closure literal; hosting the factory
here (with the dispatcher bundle travelling as Object and the result as
Closure) keeps PackedClosure off the emitted-bytecode surface and
GeneratedDispatcher.Bundle out of every creation site (only the hosting class's
dispatcher factory names it). The cast is negligible against the object-creation cost.
owner - the enclosing instance (or the enclosing Class in a static context)dispatchers - the hosting class's linked GeneratedDispatcher.Bundleid - the hoisted body's compile-time id in the class's dispatch tablesmethod - the hoisted method's name (diagnostics only)captured - captured values (References for written captures), or nullparamTypes - the literal's declared parameter typesstrict - whether the adapter installs the fail-fast delegate guard (dynamic trust path)implicit - whether the literal has an implicit it parameter (fuzzy 0/1 arity)vararg - whether the literal's last parameter is a trailing array (varargs selection) The packed-closure factory the compiler emits: as
packedClosure(Object, Object, int, String, Object[], Class[], boolean, boolean, boolean),
which stays for class files compiled before it, plus whether the hoisted body uses its
receiver, so rehydrate hands the copy's body a new this object wherever a
@CompileStatic closure class would use it.
usesReceiver - whether the hoisted body uses its receiver Compiles regex into a Pattern. regex is converted with
toString() and passed to StringGroovyMethods.bitwiseNegate.
Throws PatternSyntaxException if regex is not a valid regular expression.
regex - the expression to compile; its toString() result is compiled Selects a constructor of which and transforms arguments. The metaclass is
InvokerHelper.getMetaClass(which), and
MetaClass.selectConstructorAndTransformArguments performs the
selection. A GroovyRuntimeException is passed to unwrap and rethrown.
arguments - the constructor arguments transformed by the metaclassnumberOfConstructors - the constructor count supplied by the callerwhich - the class whose constructor is selected Writes the field named messageName by calling InvokerHelper.setAttribute.
The helper replaces a null receiver with NullObject. A
GroovyRuntimeException is passed to unwrap and rethrown.
messageArgument - the value to writesenderClass - the class that originated the callreceiver - the receiver of the callmessageName - the field name Writes the field named messageName, using the super-class attribute unless
receiver is a Class.
When receiver is a Class, the write is InvokerHelper.setAttribute.
Any other receiver is cast to GroovyObject and written with
MetaClass.setAttribute, passing
useSuper true and fromInsideClass true. A GroovyRuntimeException
is passed to unwrap and rethrown.
messageArgument - the value to writesenderClass - the class that originated the callreceiver - the receiver of the callmessageName - the field name Forwards to setFieldOnSuper with the same arguments. A null receiver is
passed through on that call.
messageArgument - the value to writesenderClass - the class that originated the callreceiver - the receiver of the callmessageName - the field name Writes the field named messageName on each element of receiver.
InvokerHelper.asIterator walks receiver with no null test, and each
element is written with setFieldOnSuper.
messageArgument - the value to writesenderClass - the class that originated the callreceiver - the receiver of the callmessageName - the field name Writes the field named messageName, doing nothing when receiver is null. A
non-null receiver is written with setField.
messageArgument - the value to writesenderClass - the class that originated the callreceiver - the receiver of the callmessageName - the field name Writes the field named messageName on each element of receiver. A null
receiver returns without writing. Otherwise InvokerHelper.asIterator walks the
receiver and each element is written with setFieldSafe.
messageArgument - the value to writesenderClass - the class that originated the callreceiver - the receiver of the callmessageName - the field name Writes the field named messageName on a GroovyObject through its
metaclass. MetaClass.setAttribute
is called with useSuper false and fromInsideClass false. A
GroovyRuntimeException is passed to unwrap and rethrown.
messageArgument - the value to writesenderClass - the class that originated the callreceiver - the receiver of the callmessageName - the field name Writes the field named messageName, doing nothing when receiver is null. A
non-null receiver is written with the metaclass method
setAttribute(Object, String, Object), passing the receiver, the field name, and
messageArgument. A GroovyRuntimeException is passed to unwrap and
rethrown.
messageArgument - the value to writesenderClass - the class that originated the callreceiver - the receiver of the callmessageName - the field name Writes the field named messageName on each element of receiver. A null
receiver returns without writing. Otherwise InvokerHelper.asIterator walks the
receiver and each element is written with setFieldSafe.
messageArgument - the value to writesenderClass - the class that originated the callreceiver - the receiver of the callmessageName - the field name Writes messageName on a GroovyObject, using the object's own setter when
the sender requires it.
When senderClass is null or
GroovyObjectOverrides.overridesSetProperty is true,
GroovyObject.setProperty is called and the method returns. A
MissingPropertyException from that call is passed to unwrap and rethrown
when senderClass is null, is the receiver's own class, or the receiver is not an
instance of senderClass. Any other GroovyRuntimeException is unwrapped and
rethrown. Otherwise the receiver's metaclass
MetaClass.setProperty is called
with isCallToSuper false and fromInsideClass false.
messageArgument - the value to writesenderClass - the class that originated the callreceiver - the receiver of the callmessageName - the property name Writes messageName on receiver, doing nothing when receiver is
null. A non-null receiver is written with
GroovyObject.setProperty. The call is not passed to the metaclass
and is not unwrapped.
messageArgument - the value to writesenderClass - the class that originated the callreceiver - the receiver of the callmessageName - the property name Writes the property named messageName on each element of receiver. A null
receiver returns without writing. Otherwise InvokerHelper.asIterator walks the
receiver and each element is written with setPropertySafe.
messageArgument - the value to writesenderClass - the class that originated the callreceiver - the receiver of the callmessageName - the property name Writes messageArgument to the property named messageName.
A null receiver is written through NullObject.getNullObject(). A
GroovyObject is written with GroovyObject.setProperty when
senderClass is null or GroovyObjectOverrides.overridesSetProperty
is true for the receiver's class, including when that method cannot be inspected. Every
other receiver is written through the metaclass from InvokerHelper.getMetaClass,
calling MetaClass.setProperty
with isCallToSuper false and fromInsideClass false.
If that write throws MissingPropertyException, receiver is a
GroovyObject, and senderClass is a GeneratedClosure, the sender is
replaced by its enclosing class and that replacement repeats while the class is a
generated closure. When the resulting class differs from the receiver's class and the
receiver is an instance of it, the metaclass write is repeated with that class as the
sender and with isCallToSuper and fromInsideClass both false, and the
method returns. Otherwise the original GroovyRuntimeException is passed to
unwrap and rethrown. An exception thrown by the retried write is not caught here.
messageArgument - the value to writesenderClass - the class that originated the callreceiver - the receiver of the callmessageName - the property name Writes the property named messageName on the super class of a
GroovyObject. The receiver's metaclass
MetaClass.setProperty is called
with isCallToSuper true and fromInsideClass false. A
GroovyRuntimeException is passed to unwrap and rethrown.
messageArgument - the value to writesenderClass - the class that originated the callreceiver - the receiver of the callmessageName - the property name Forwards to setPropertyOnSuper with the same arguments. A null receiver
is passed through on that call.
messageArgument - the value to writesenderClass - the class that originated the callreceiver - the receiver of the callmessageName - the property name Writes the property named messageName on each element of receiver.
InvokerHelper.asIterator walks receiver with no null test, and each
element is written with setPropertySafe.
messageArgument - the value to writesenderClass - the class that originated the callreceiver - the receiver of the callmessageName - the property name Writes the property named messageName, doing nothing when receiver is
null. A non-null receiver is written with setProperty.
messageArgument - the value to writesenderClass - the class that originated the callreceiver - the receiver of the callmessageName - the property name Writes the property named messageName on each element of receiver. A null
receiver returns without writing. Otherwise InvokerHelper.asIterator walks the
receiver and each element is written with setPropertySafe.
messageArgument - the value to writesenderClass - the class that originated the callreceiver - the receiver of the callmessageName - the property name Spreads value as a map by calling InvokerHelper.spreadMap. A Map
is flattened, in key-set order, into alternating keys and values. A non-null value that is
not a map causes SpreadMapEvaluatingException. A null value fails with
NullPointerException while that exception message is built.
value - the map to spreadvalue's entries Returns the negation of value from InvokerHelper.unaryMinus.
Integer, Long, Double, Float, Short, and
Byte are negated arithmetically, with Short and Byte cast back to
those types. BigInteger and BigDecimal use negate(). An
ArrayList yields a new list of element-wise results. Any other value, including
another kind of List, is sent the no-argument message negative. A
GroovyRuntimeException raised by the helper propagates without unwrap.
value - the value to negate Returns the unary plus of value from InvokerHelper.unaryPlus.
Integer, Long, BigInteger, BigDecimal, Double,
Float, Short, and Byte are returned unchanged. An
ArrayList yields a new list of element-wise results. Any other value is sent the
no-argument message positive. A GroovyRuntimeException is passed to
unwrap and rethrown.
value - the value to which unary plus is appliedUnwraps a GroovyRuntimeException, extracting the actual cause if present. Converts GroovyRuntimeException instances that wrap actual exceptions to those exceptions.
gre - the GroovyRuntimeException to unwrap