Interface CallSite
- All Known Implementing Classes:
AbstractCallSite,ConstructorMetaClassSite,ConstructorMetaMethodSite,ConstructorSite,ConstructorSite.ConstructorSiteNoUnwrap,ConstructorSite.ConstructorSiteNoUnwrapNoCoerce,ConstructorSite.NoParamSite,ConstructorSite.NoParamSiteInnerClass,GetEffectivePogoFieldSite,GetEffectivePojoPropertySite,MetaClassConstructorSite,MetaClassSite,MetaMethodSite,NullCallSite,PerInstancePojoMetaClassSite,PlainObjectMetaMethodSite,PogoGetPropertySite,PogoInterceptableSite,PogoMetaClassGetPropertySite,PogoMetaClassSite,PogoMetaMethodSite,PogoMetaMethodSite.PogoCachedMethodSite,PogoMetaMethodSite.PogoCachedMethodSiteNoUnwrap,PogoMetaMethodSite.PogoCachedMethodSiteNoUnwrapNoCoerce,PogoMetaMethodSite.PogoMetaMethodSiteNoUnwrap,PogoMetaMethodSite.PogoMetaMethodSiteNoUnwrapNoCoerce,PojoMetaClassGetPropertySite,PojoMetaClassSite,PojoMetaMethodSite,PojoMetaMethodSite.PojoCachedMethodSite,PojoMetaMethodSite.PojoCachedMethodSiteNoUnwrap,PojoMetaMethodSite.PojoCachedMethodSiteNoUnwrapNoCoerce,PojoMetaMethodSite.PojoMetaMethodSiteNoUnwrap,PojoMetaMethodSite.PojoMetaMethodSiteNoUnwrapNoCoerce,StaticMetaClassSite,StaticMetaMethodSite,StaticMetaMethodSite.StaticMetaMethodSiteNoUnwrap,StaticMetaMethodSite.StaticMetaMethodSiteNoUnwrapNoCoerce
public interface CallSite
Classic (non-
invokedynamic) call site.
Prefer invokedynamic call sites for new code. Planned for deprecation/removal in a future Groovy version.
-
Method Summary
Modifier and TypeMethodDescriptionInvokes the named method onreceiverwith no arguments.Invokes the named method onreceiverwith one argument.Invokes the named method onreceiverwithargs.Invokes the named method onreceiverwith two arguments.Invokes the named method onreceiverwith three arguments.Invokes the named method onreceiverwith four arguments.callConstructor(Object receiver) Invokes a constructor selected forreceiverwith no arguments.callConstructor(Object receiver, Object arg1) Invokes a constructor selected forreceiverwith one argument.callConstructor(Object receiver, Object[] args) Invokes a constructor selected forreceiverwithargs.callConstructor(Object receiver, Object arg1, Object arg2) Invokes a constructor selected forreceiverwith two arguments.callConstructor(Object receiver, Object arg1, Object arg2, Object arg3) Invokes a constructor selected forreceiverwith three arguments.Invokes a constructor selected forreceiverwith four arguments.callCurrent(GroovyObject receiver) Invokes the named method on the current object with no arguments.callCurrent(GroovyObject receiver, Object arg1) Invokes the named method on the current object with one argument.callCurrent(GroovyObject receiver, Object[] args) Invokes the named method on the current object withargs.callCurrent(GroovyObject receiver, Object arg1, Object arg2) Invokes the named method on the current object with two arguments.callCurrent(GroovyObject receiver, Object arg1, Object arg2, Object arg3) Invokes the named method on the current object with three arguments.callCurrent(GroovyObject receiver, Object arg1, Object arg2, Object arg3, Object arg4) Invokes the named method on the current object with four arguments.callGetProperty(Object receiver) Reads the named property ofreceiver.callGetPropertySafe(Object receiver) Reads the named property ofreceiver, returning null whenreceiveris null.callGroovyObjectGetProperty(Object receiver) Reads the named property throughGroovyObject.getProperty(String).callGroovyObjectGetPropertySafe(Object receiver) Reads the named property throughGroovyObject.getProperty(String), returning null whenreceiveris null.Invokes the named method onreceiverwith no arguments, returning null whenreceiveris null.Invokes the named method onreceiverwith one argument, returning null whenreceiveris null.Invokes the named method onreceiverwithargs, returning null whenreceiveris null.Invokes the named method onreceiverwith two arguments, returning null whenreceiveris null.Invokes the named method onreceiverwith three arguments, returning null whenreceiveris null.Invokes the named method onreceiverwith four arguments, returning null whenreceiveris null.callStatic(Class receiver) Invokes the named static method onreceiverwith no arguments.callStatic(Class receiver, Object arg1) Invokes the named static method onreceiverwith one argument.callStatic(Class receiver, Object[] args) Invokes the named static method onreceiverwithargs.callStatic(Class receiver, Object arg1, Object arg2) Invokes the named static method onreceiverwith two arguments.callStatic(Class receiver, Object arg1, Object arg2, Object arg3) Invokes the named static method onreceiverwith three arguments.Invokes the named static method onreceiverwith four arguments.getArray()Returns the array that owns this site.intgetIndex()Returns this site's index ingetArray().getName()Returns the method or property name this site calls.getProperty(Object receiver) Reads the named property ofreceiver.
-
Method Details
-
getArray
CallSiteArray getArray()Returns the array that owns this site.- Returns:
- the owning call-site array
-
getIndex
int getIndex()Returns this site's index ingetArray().- Returns:
- the index
-
getName
String getName()Returns the method or property name this site calls.- Returns:
- the name
-
getProperty
Reads the named property ofreceiver.- Parameters:
receiver- the object whose property is read- Returns:
- the property value
- Throws:
Throwable- when the read fails
-
callGetPropertySafe
Reads the named property ofreceiver, returning null whenreceiveris null.- Parameters:
receiver- the object whose property is read; may be null- Returns:
- the property value, or null when
receiveris null - Throws:
Throwable- when the read fails
-
callGetProperty
Reads the named property ofreceiver.- Parameters:
receiver- the object whose property is read- Returns:
- the property value
- Throws:
Throwable- when the read fails
-
callGroovyObjectGetProperty
Reads the named property throughGroovyObject.getProperty(String).- Parameters:
receiver- the Groovy object whose property is read- Returns:
- the property value
- Throws:
Throwable- when the read fails
-
callGroovyObjectGetPropertySafe
Reads the named property throughGroovyObject.getProperty(String), returning null whenreceiveris null.- Parameters:
receiver- the Groovy object whose property is read; may be null- Returns:
- the property value, or null when
receiveris null - Throws:
Throwable- when the read fails
-
call
Invokes the named method onreceiverwithargs.- Parameters:
receiver- the target of the callargs- the arguments, in order- Returns:
- the value returned by the method
- Throws:
Throwable- when the call fails
-
call
Invokes the named method onreceiverwith no arguments.- Parameters:
receiver- the target of the call- Returns:
- the value returned by the method
- Throws:
Throwable- when the call fails
-
call
Invokes the named method onreceiverwith one argument.- Parameters:
receiver- the target of the callarg1- the only argument- Returns:
- the value returned by the method
- Throws:
Throwable- when the call fails
-
call
Invokes the named method onreceiverwith two arguments.- Parameters:
receiver- the target of the callarg1- the first argumentarg2- the second argument- Returns:
- the value returned by the method
- Throws:
Throwable- when the call fails
-
call
@GroovyABI(since="1.6.0") Object call(Object receiver, Object arg1, Object arg2, Object arg3) throws Throwable Invokes the named method onreceiverwith three arguments.- Parameters:
receiver- the target of the callarg1- the first argumentarg2- the second argumentarg3- the third argument- Returns:
- the value returned by the method
- Throws:
Throwable- when the call fails
-
call
@GroovyABI(since="1.6.0") Object call(Object receiver, Object arg1, Object arg2, Object arg3, Object arg4) throws Throwable Invokes the named method onreceiverwith four arguments.- Parameters:
receiver- the target of the callarg1- the first argumentarg2- the second argumentarg3- the third argumentarg4- the fourth argument- Returns:
- the value returned by the method
- Throws:
Throwable- when the call fails
-
callSafe
Invokes the named method onreceiverwithargs, returning null whenreceiveris null.- Parameters:
receiver- the target of the call; may be nullargs- the arguments, in order- Returns:
- the value returned by the method, or null when
receiveris null - Throws:
Throwable- when the call fails
-
callSafe
Invokes the named method onreceiverwith no arguments, returning null whenreceiveris null.- Parameters:
receiver- the target of the call; may be null- Returns:
- the value returned by the method, or null when
receiveris null - Throws:
Throwable- when the call fails
-
callSafe
Invokes the named method onreceiverwith one argument, returning null whenreceiveris null.- Parameters:
receiver- the target of the call; may be nullarg1- the only argument- Returns:
- the value returned by the method, or null when
receiveris null - Throws:
Throwable- when the call fails
-
callSafe
@GroovyABI(since="1.6.0") Object callSafe(Object receiver, Object arg1, Object arg2) throws Throwable Invokes the named method onreceiverwith two arguments, returning null whenreceiveris null.- Parameters:
receiver- the target of the call; may be nullarg1- the first argumentarg2- the second argument- Returns:
- the value returned by the method, or null when
receiveris null - Throws:
Throwable- when the call fails
-
callSafe
@GroovyABI(since="1.6.0") Object callSafe(Object receiver, Object arg1, Object arg2, Object arg3) throws Throwable Invokes the named method onreceiverwith three arguments, returning null whenreceiveris null.- Parameters:
receiver- the target of the call; may be nullarg1- the first argumentarg2- the second argumentarg3- the third argument- Returns:
- the value returned by the method, or null when
receiveris null - Throws:
Throwable- when the call fails
-
callSafe
@GroovyABI(since="1.6.0") Object callSafe(Object receiver, Object arg1, Object arg2, Object arg3, Object arg4) throws Throwable Invokes the named method onreceiverwith four arguments, returning null whenreceiveris null.- Parameters:
receiver- the target of the call; may be nullarg1- the first argumentarg2- the second argumentarg3- the third argumentarg4- the fourth argument- Returns:
- the value returned by the method, or null when
receiveris null - Throws:
Throwable- when the call fails
-
callCurrent
Invokes the named method on the current object withargs.- Parameters:
receiver- the current Groovy objectargs- the arguments, in order- Returns:
- the value returned by the method
- Throws:
Throwable- when the call fails
-
callCurrent
Invokes the named method on the current object with no arguments.- Parameters:
receiver- the current Groovy object- Returns:
- the value returned by the method
- Throws:
Throwable- when the call fails
-
callCurrent
Invokes the named method on the current object with one argument.- Parameters:
receiver- the current Groovy objectarg1- the only argument- Returns:
- the value returned by the method
- Throws:
Throwable- when the call fails
-
callCurrent
@GroovyABI(since="1.6.0") Object callCurrent(GroovyObject receiver, Object arg1, Object arg2) throws Throwable Invokes the named method on the current object with two arguments.- Parameters:
receiver- the current Groovy objectarg1- the first argumentarg2- the second argument- Returns:
- the value returned by the method
- Throws:
Throwable- when the call fails
-
callCurrent
@GroovyABI(since="1.6.0") Object callCurrent(GroovyObject receiver, Object arg1, Object arg2, Object arg3) throws Throwable Invokes the named method on the current object with three arguments.- Parameters:
receiver- the current Groovy objectarg1- the first argumentarg2- the second argumentarg3- the third argument- Returns:
- the value returned by the method
- Throws:
Throwable- when the call fails
-
callCurrent
@GroovyABI(since="1.6.0") Object callCurrent(GroovyObject receiver, Object arg1, Object arg2, Object arg3, Object arg4) throws Throwable Invokes the named method on the current object with four arguments.- Parameters:
receiver- the current Groovy objectarg1- the first argumentarg2- the second argumentarg3- the third argumentarg4- the fourth argument- Returns:
- the value returned by the method
- Throws:
Throwable- when the call fails
-
callStatic
Invokes the named static method onreceiverwithargs.- Parameters:
receiver- the class that declares the methodargs- the arguments, in order- Returns:
- the value returned by the method
- Throws:
Throwable- when the call fails
-
callStatic
Invokes the named static method onreceiverwith no arguments.- Parameters:
receiver- the class that declares the method- Returns:
- the value returned by the method
- Throws:
Throwable- when the call fails
-
callStatic
Invokes the named static method onreceiverwith one argument.- Parameters:
receiver- the class that declares the methodarg1- the only argument- Returns:
- the value returned by the method
- Throws:
Throwable- when the call fails
-
callStatic
@GroovyABI(since="1.6.0") Object callStatic(Class receiver, Object arg1, Object arg2) throws Throwable Invokes the named static method onreceiverwith two arguments.- Parameters:
receiver- the class that declares the methodarg1- the first argumentarg2- the second argument- Returns:
- the value returned by the method
- Throws:
Throwable- when the call fails
-
callStatic
@GroovyABI(since="1.6.0") Object callStatic(Class receiver, Object arg1, Object arg2, Object arg3) throws Throwable Invokes the named static method onreceiverwith three arguments.- Parameters:
receiver- the class that declares the methodarg1- the first argumentarg2- the second argumentarg3- the third argument- Returns:
- the value returned by the method
- Throws:
Throwable- when the call fails
-
callStatic
@GroovyABI(since="1.6.0") Object callStatic(Class receiver, Object arg1, Object arg2, Object arg3, Object arg4) throws Throwable Invokes the named static method onreceiverwith four arguments.- Parameters:
receiver- the class that declares the methodarg1- the first argumentarg2- the second argumentarg3- the third argumentarg4- the fourth argument- Returns:
- the value returned by the method
- Throws:
Throwable- when the call fails
-
callConstructor
Invokes a constructor selected forreceiverwithargs.- Parameters:
receiver- the constructor's owner, as supplied by the callerargs- the constructor arguments, in order- Returns:
- the constructed object
- Throws:
Throwable- when construction fails
-
callConstructor
Invokes a constructor selected forreceiverwith no arguments.- Parameters:
receiver- the constructor's owner, as supplied by the caller- Returns:
- the constructed object
- Throws:
Throwable- when construction fails
-
callConstructor
Invokes a constructor selected forreceiverwith one argument.- Parameters:
receiver- the constructor's owner, as supplied by the callerarg1- the only constructor argument- Returns:
- the constructed object
- Throws:
Throwable- when construction fails
-
callConstructor
@GroovyABI(since="1.6.0") Object callConstructor(Object receiver, Object arg1, Object arg2) throws Throwable Invokes a constructor selected forreceiverwith two arguments.- Parameters:
receiver- the constructor's owner, as supplied by the callerarg1- the first constructor argumentarg2- the second constructor argument- Returns:
- the constructed object
- Throws:
Throwable- when construction fails
-
callConstructor
@GroovyABI(since="1.6.0") Object callConstructor(Object receiver, Object arg1, Object arg2, Object arg3) throws Throwable Invokes a constructor selected forreceiverwith three arguments.- Parameters:
receiver- the constructor's owner, as supplied by the callerarg1- the first constructor argumentarg2- the second constructor argumentarg3- the third constructor argument- Returns:
- the constructed object
- Throws:
Throwable- when construction fails
-
callConstructor
@GroovyABI(since="1.6.0") Object callConstructor(Object receiver, Object arg1, Object arg2, Object arg3, Object arg4) throws Throwable Invokes a constructor selected forreceiverwith four arguments.- Parameters:
receiver- the constructor's owner, as supplied by the callerarg1- the first constructor argumentarg2- the second constructor argumentarg3- the third constructor argumentarg4- the fourth constructor argument- Returns:
- the constructed object
- Throws:
Throwable- when construction fails
-