public class PojoMetaMethodSite
extends PlainObjectMetaMethodSite
POJO call site metaclass - cached method - cached
| Modifiers | Name | Description |
|---|---|---|
static class |
PojoMetaMethodSite.PojoCachedMethodSite |
POJO site that invokes a reflected Method. |
static class |
PojoMetaMethodSite.PojoCachedMethodSiteNoUnwrap |
Reflected POJO site that skips MetaClassHelper.unwrap. |
static class |
PojoMetaMethodSite.PojoCachedMethodSiteNoUnwrapNoCoerce |
Reflected POJO site that skips both MetaClassHelper.unwrap and MetaMethod.coerceArgumentsToClasses. |
static class |
PojoMetaMethodSite.PojoMetaMethodSiteNoUnwrap |
Call site where we know there is no need to unwrap arguments |
static class |
PojoMetaMethodSite.PojoMetaMethodSiteNoUnwrapNoCoerce |
Call site where we know there is no need neither unwrap nor coerce arguments |
| Modifiers | Name | Description |
|---|---|---|
protected int |
version |
Meta-class version recorded by the constructor. |
| Fields inherited from class | Fields |
|---|---|
class MetaMethodSite |
params |
class MetaClassSite |
metaClass |
class AbstractCallSite |
array, index, name |
| Constructor and description |
|---|
PojoMetaMethodSite(CallSite site, MetaClassImpl metaClass, MetaMethod metaMethod, Class[] params)Caches metaClass, metaMethod, and params, and
records metaClass's version in version. |
| 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.
|
|
protected final boolean |
checkCall(Object receiver, Object[] args)Returns true when receiver's class is the meta-class's
class, checkPojoMetaClass() passes, and
MetaClassHelper.sameClasses matches the
cached parameter classes to args. |
|
protected final boolean |
checkCall(Object receiver)Returns true when receiver's class is the meta-class's
class, checkPojoMetaClass() passes, and
MetaClassHelper.sameClasses reports that the cached
parameter list is empty. |
|
protected final boolean |
checkCall(Object receiver, Object arg1)Returns true when receiver's class is the meta-class's
class, checkPojoMetaClass() passes, and
MetaClassHelper.sameClasses matches the cached
parameter class to arg1. |
|
protected final boolean |
checkCall(Object receiver, Object arg1, Object arg2)Returns true when receiver's class is the meta-class's
class, checkPojoMetaClass() passes, 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's class is the meta-class's
class, checkPojoMetaClass() passes, 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's class is the meta-class's
class, checkPojoMetaClass() passes, and
MetaClassHelper.sameClasses
matches the cached parameter classes to arg1 through
arg4. |
|
protected final boolean |
checkPojoMetaClass()Returns whether the current thread has no Groovy category and MetaClassImpl.getVersion is still version. |
|
public static CallSite |
createCachedMethodSite(CallSite site, MetaClassImpl metaClass, CachedMethod metaMethod, Class[] params, Object[] args)Chooses a CachedMethod site from args.
|
|
public static CallSite |
createNonAwareCallSite(CallSite site, MetaClassImpl metaClass, MetaMethod metaMethod, Class[] params, Object[] args)Chooses a PojoMetaMethodSite from args.
|
|
public static CallSite |
createPojoMetaMethodSite(CallSite site, MetaClassImpl metaClass, MetaMethod metaMethod, Class[] params, Object receiver, Object[] args)Returns a site for metaMethod. |
|
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 PlainObjectMetaMethodSite |
doInvoke |
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 |
Meta-class version recorded by the constructor. checkPojoMetaClass() accepts the site only while MetaClassImpl.getVersion is still this value.
Caches metaClass, metaMethod, and params, and
records metaClass's version in version.
When checkCall(Object, Object[]) passes, invoke(Object, Object[])
unwraps args and calls MetaMethod.doMethodInvoke.
Otherwise falls back to CallSiteArray.defaultCall.
Returns true when receiver's class is the meta-class's
class, checkPojoMetaClass() passes, and
MetaClassHelper.sameClasses matches the
cached parameter classes to args. A null receiver is
checked again as NullObject. Any other
NullPointerException is rethrown.
Returns true when receiver's class is the meta-class's
class, checkPojoMetaClass() passes, and
MetaClassHelper.sameClasses reports that the cached
parameter list is empty. A null receiver is checked again as
NullObject. Any other NullPointerException is rethrown.
Returns true when receiver's class is the meta-class's
class, checkPojoMetaClass() passes, and
MetaClassHelper.sameClasses matches the cached
parameter class to arg1. A null receiver is checked
again as NullObject. Any other NullPointerException
is rethrown.
Returns true when receiver's class is the meta-class's
class, checkPojoMetaClass() passes, and
MetaClassHelper.sameClasses matches
the cached parameter classes to arg1 and arg2. A
null receiver is checked again as NullObject. Any
other NullPointerException is rethrown.
Returns true when receiver's class is the meta-class's
class, checkPojoMetaClass() passes, and
MetaClassHelper.sameClasses
matches the cached parameter classes to arg1, arg2,
and arg3. A null receiver is checked again as
NullObject. Any other NullPointerException is rethrown.
Returns true when receiver's class is the meta-class's
class, checkPojoMetaClass() passes, and
MetaClassHelper.sameClasses
matches the cached parameter classes to arg1 through
arg4. A null receiver is checked again as
NullObject. Any other NullPointerException is rethrown.
Returns whether the current thread has no Groovy category and MetaClassImpl.getVersion is still version.
Chooses a CachedMethod site from args.
When MetaMethod.correctArguments returns the same
array and noWrappers(args) is true, returns a
PojoCachedMethodSiteNoUnwrap if noCoerce is true,
and otherwise delegates to
CachedMethodCallSites.createPojoMetaMethodSite.
Otherwise returns a PojoCachedMethodSite, whose invoke
unwraps, coerces, and reflects.
Chooses a PojoMetaMethodSite from args.
When MetaMethod.correctArguments returns the same
array and noWrappers(args) is true, returns a
PojoMetaMethodSiteNoUnwrap if noCoerce is true (its
invoke calls MetaMethod.doMethodInvoke
and skips MetaClassHelper.unwrap) and a
PojoMetaMethodSiteNoUnwrapNoCoerce if noCoerce is false
(its invoke calls MetaMethod.invoke
with no unwrap and no coerce).
Otherwise returns a PojoMetaMethodSite.
Returns a site for metaMethod. When its class is exactly
CachedMethod, delegates to createCachedMethodSite.
Otherwise delegates to createNonAwareCallSite.
receiver is unused.
Unwraps args with MetaClassHelper.unwrap
and calls MetaMethod.doMethodInvoke, which
coerces them. Performs no receiver, meta-class version, or
argument-class check.
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.