public final class PackedClosureMetaClass
extends MetaClassImpl
The stock metaclass for PackedClosure, giving packed closures their own MOP standing (the analog of ClosureMetaClass for generated closure classes, whose per-class metaclasses packed closures deliberately do not have).
invokeMethod("call"/"doCall") dispatches straight to the adapter — a plain
virtual call that routes to the hosting class's dispatch tables — with no reflection
anywhere on the path, and, matching ClosureMetaClass, without consulting
categories for the closure-invocation names (categories have never applied to closure
doCall dispatch). Each fixed-arity family member class gets its own instance of
this metaclass from the registry (a per-class registry can only be per-adapter-class),
so class-level metaclass changes affect every packed closure of that member's arity;
per-instance setMetaClass is honoured as usual — the adapter's dispatch guard
routes perturbed instances through the replacement's invokeMethod.
respondsTo(Object, String, Object[]) is instance-faithful: the fixed-arity
family member's doCall(s) are erased to Object parameters (and
FixedN's is varargs), so the answer for the closure-invocation names is
additionally filtered by the instance's declared parameter types (which the adapter
carries for exactly this purpose). Purely class-level introspection
(pickMethod, getMetaMethods) necessarily reflects the shared adapter
class, not any single literal.
| Fields inherited from class | Fields |
|---|---|
class MetaClassImpl |
EMPTY_ARGUMENTS, INVOKE_METHOD_METHOD, METHOD_MISSING, PROPERTY_MISSING, STATIC_METHOD_MISSING, STATIC_PROPERTY_MISSING, getPropertyMethod, invokeMethodMethod, isGroovyObject, isMap, metaMethodIndex, registry, setPropertyMethod, theCachedClass, theClass |
| Constructor and description |
|---|
PackedClosureMetaClass(MetaClassRegistry registry, Class theClass) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public Object |
invokeMethod(Class sender, Object object, String methodName, Object[] originalArguments, boolean isCallToSuper, boolean fromInsideClass) |
|
public List<MetaMethod> |
respondsTo(Object obj, String name, Object[] argTypes) |
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.