public static final class PackedClosure.Fixed1
extends PackedClosure
implements GeneratedClosure
Packed closure whose only doCall takes one argument and passes it to dispatchOne after coercion.
| Fields inherited from class | Fields |
|---|---|
class Closure |
DELEGATE_FIRST, DELEGATE_ONLY, DONE, IDENTITY, OWNER_FIRST, OWNER_ONLY, TO_SELF, maximumNumberOfParameters, parameterTypes |
| Methods inherited from class | Name |
|---|---|
class PackedClosure |
call, call, create, create, dispatchAll, rehydrate, setDelegate, setResolveStrategy, toString |
class Closure |
additionalReferences, andThen, andThenSelf, andThenSelf, asWritable, call, call, call, checkForReferenceCycle, clone, compose, composeSelf, composeSelf, curry, curry, dehydrate, getDelegate, getDirective, getMaximumNumberOfParameters, getOwner, getParameterTypes, getProperty, getResolveStrategy, getThisObject, isCase, leftShift, leftShift, memoize, memoizeAtLeast, memoizeAtMost, memoizeBetween, mopUnperturbed, ncurry, ncurry, rcurry, rcurry, rehydrate, rightShift, run, setDelegate, setDirective, setMetaClass, setProperty, setResolveStrategy, throwRuntimeException, trampoline, trampoline |
class GroovyObjectSupport |
getMetaClass, setMetaClass |
Initializes the one-parameter packed closure. doCall(Object) coerces that argument and dispatches the one value.
The arguments are forwarded to PackedClosure. owner is
stored as the closure owner, the delegate, and the this object,
and as the receiver each later dispatch passes to the hoisted method.
The general, one-value, and two-value dispatchers are taken from
dispatchers. id and method are stored.
captured is kept by reference, and a null array is replaced with
an empty one. Closure first fills the parameter metadata by
reflecting this member's doCall; that metadata is then replaced
by visibleTypes, which is also kept by reference.
owner - the object stored as the closure owner, the delegate, and the
this object, and as the receiver passed to the hoisted method.
A static hoisted method is given the enclosing classdispatchers - the hosting class's GeneratedDispatcher tables.
The general, one-value, and two-value dispatchers are read from this bundleid - index of the hoisted method in those tablesmethod - name of the hoisted method, kept for diagnosticscaptured - values closed over from the enclosing scope and passed ahead
of the call arguments. null is stored as an empty array; a
non-null array is retained by referencevisibleTypes - declared parameter types, retained by reference and
installed as this closure's parameter metadata in place of the types
reflected from doCallstrict - value stored for the delegate and resolve-strategy guards.
true makes a non-null delegate other than the owner, or a strategy other
than owner-first or owner-only, fail when it is set Coerces a to the first stored parameter type and invokes
the hoisted method with that one value.
A parameter type of Object, a null argument, or an argument
that is already an instance of the parameter type is passed through.
Every other value is coerced with the metaclass rules used for a
generated closure, and a value that cannot be coerced raises
MissingMethodException. No captured values use the
one-value dispatch table, one captured value uses the two-value
table with the capture before the argument, and any further
captures are packed with the receiver and the argument for the
general table. An exception thrown by the
hoisted method propagates to the caller.
a - value supplied for the closure's parameternull when that method is voidCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.