public class StaticMetaMethodSite
extends MetaMethodSite
POJO call site metaclass - cached method - cached
| Modifiers | Name | Description |
|---|---|---|
static class |
StaticMetaMethodSite.StaticMetaMethodSiteNoUnwrap |
Call site where we know there is no need to unwrap arguments |
static class |
StaticMetaMethodSite.StaticMetaMethodSiteNoUnwrapNoCoerce |
Call site where we know there is no need neither unwrap nor coerce arguments |
| Fields inherited from class | Fields |
|---|---|
class MetaMethodSite |
params |
class MetaClassSite |
metaClass |
class AbstractCallSite |
array, index, name |
| Constructor and description |
|---|
StaticMetaMethodSite(CallSite site, MetaClassImpl metaClass, MetaMethod metaMethod, Class[] params)Caches metaClass, metaMethod, and params, and
records metaClass's version for checkCall(Object, Object[]). |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public Object |
call(Object receiver, Object[] args)When checkCall(Object, Object[]) passes, invoke(Object, Object[]) unwraps args and calls MetaMethod.doMethodInvoke.
|
|
public Object |
callStatic(Class receiver, Object[] args)When checkCall(Object, Object[]) passes, invoke(Object, Object[]) unwraps args and calls MetaMethod.doMethodInvoke.
|
|
protected final boolean |
checkCall(Object receiver, Object[] args)Returns true when receiver is the meta-class's class,
the meta-class version is still the version recorded at construction,
and MetaClassHelper.sameClasses matches the
cached parameter classes to args. |
|
protected final boolean |
checkCall(Object receiver)Returns true when receiver is the meta-class's class,
the meta-class version is still the version recorded at construction,
and MetaClassHelper.sameClasses reports that the
cached parameter list is empty. |
|
protected final boolean |
checkCall(Object receiver, Object arg1)Returns true when receiver is the meta-class's class,
the meta-class version is still the version recorded at construction,
and MetaClassHelper.sameClasses matches the
cached parameter class to arg1. |
|
protected final boolean |
checkCall(Object receiver, Object arg1, Object arg2)Returns true when receiver is the meta-class's class,
the meta-class version is still the version recorded at construction,
and MetaClassHelper.sameClasses
matches the cached parameter classes to arg1 and arg2. |
|
protected final boolean |
checkCall(Object receiver, Object arg1, Object arg2, Object arg3)Returns true when receiver is the meta-class's class,
the meta-class version is still the version recorded at construction,
and MetaClassHelper.sameClasses
matches the cached parameter classes to arg1, arg2,
and arg3. |
|
protected final boolean |
checkCall(Object receiver, Object arg1, Object arg2, Object arg3, Object arg4)Returns true when receiver is the meta-class's class,
the meta-class version is still the version recorded at construction,
and MetaClassHelper.sameClasses
matches the cached parameter classes to arg1 through
arg4. |
|
public static CallSite |
createStaticMetaMethodSite(CallSite site, MetaClassImpl metaClass, MetaMethod metaMethod, Class[] params, Object[] args)Chooses a static site from args.
|
|
public Object |
invoke(Object receiver, Object[] args)Unwraps args with MetaClassHelper.unwrap
and calls MetaMethod.doMethodInvoke, which
coerces them. |
| Methods inherited from class | Name |
|---|---|
class AbstractCallSite |
acceptGetProperty, acceptGroovyObjectGetProperty, call, call, call, call, call, call, callConstructor, callConstructor, callConstructor, callConstructor, callConstructor, callConstructor, callCurrent, callCurrent, callCurrent, callCurrent, callCurrent, callCurrent, callGetProperty, callGetPropertySafe, callGroovyObjectGetProperty, callGroovyObjectGetPropertySafe, callSafe, callSafe, callSafe, callSafe, callSafe, callSafe, callStatic, callStatic, callStatic, callStatic, callStatic, callStatic, createGetPropertySite, createGroovyObjectGetPropertySite, getArray, getIndex, getName, getProperty |
Caches metaClass, metaMethod, and params, and
records metaClass's version for checkCall(Object, Object[]).
When checkCall(Object, Object[]) passes, invoke(Object, Object[])
unwraps args and calls MetaMethod.doMethodInvoke.
A GroovyRuntimeException from that call is rethrown via
ScriptBytecodeAdapter.unwrap.
Otherwise falls back to CallSiteArray.defaultCall.
When checkCall(Object, Object[]) passes, invoke(Object, Object[])
unwraps args and calls MetaMethod.doMethodInvoke.
Otherwise falls back to
CallSiteArray.defaultCallStatic.
Returns true when receiver is the meta-class's class,
the meta-class version is still the version recorded at construction,
and MetaClassHelper.sameClasses matches the
cached parameter classes to args.
Returns true when receiver is the meta-class's class,
the meta-class version is still the version recorded at construction,
and MetaClassHelper.sameClasses reports that the
cached parameter list is empty.
Returns true when receiver is the meta-class's class,
the meta-class version is still the version recorded at construction,
and MetaClassHelper.sameClasses matches the
cached parameter class to arg1.
Returns true when receiver is the meta-class's class,
the meta-class version is still the version recorded at construction,
and MetaClassHelper.sameClasses
matches the cached parameter classes to arg1 and arg2.
Returns true when receiver is the meta-class's class,
the meta-class version is still the version recorded at construction,
and MetaClassHelper.sameClasses
matches the cached parameter classes to arg1, arg2,
and arg3.
Returns true when receiver is the meta-class's class,
the meta-class version is still the version recorded at construction,
and MetaClassHelper.sameClasses
matches the cached parameter classes to arg1 through
arg4.
Chooses a static site from args.
When MetaMethod.correctArguments returns the same
array and noWrappers(args) is true: if noCoerce is
true, returns a StaticMetaMethodSiteNoUnwrap (its invoke
calls MetaMethod.doMethodInvoke and skips
MetaClassHelper.unwrap); if noCoerce is false
and metaMethod's class is exactly CachedMethod,
delegates to
CachedMethodCallSites.createStaticMetaMethodSite;
otherwise returns a StaticMetaMethodSiteNoUnwrapNoCoerce (its
invoke calls MetaMethod.invoke with
no unwrap and no coerce).
If those argument checks fail, returns a StaticMetaMethodSite.
Unwraps args with MetaClassHelper.unwrap
and calls MetaMethod.doMethodInvoke, which
coerces them. A GroovyRuntimeException is rethrown via
ScriptBytecodeAdapter.unwrap.
Performs no receiver, meta-class version, or argument-class check.
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.