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 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 in getArray().
      Returns:
      the index
    • getName

      String getName()
      Returns the method or property name this site calls.
      Returns:
      the name
    • getProperty

      Object getProperty(Object receiver) throws Throwable
      Reads the named property of receiver.
      Parameters:
      receiver - the object whose property is read
      Returns:
      the property value
      Throws:
      Throwable - when the read fails
    • callGetPropertySafe

      @GroovyABI(since="1.6.0") Object callGetPropertySafe(Object receiver) throws Throwable
      Reads the named property of receiver, returning null when receiver is null.
      Parameters:
      receiver - the object whose property is read; may be null
      Returns:
      the property value, or null when receiver is null
      Throws:
      Throwable - when the read fails
    • callGetProperty

      @GroovyABI(since="1.6.0") Object callGetProperty(Object receiver) throws Throwable
      Reads the named property of receiver.
      Parameters:
      receiver - the object whose property is read
      Returns:
      the property value
      Throws:
      Throwable - when the read fails
    • callGroovyObjectGetProperty

      @GroovyABI(since="1.6.0") Object callGroovyObjectGetProperty(Object receiver) throws Throwable
      Reads the named property through GroovyObject.getProperty(String).
      Parameters:
      receiver - the Groovy object whose property is read
      Returns:
      the property value
      Throws:
      Throwable - when the read fails
    • callGroovyObjectGetPropertySafe

      @GroovyABI(since="1.6.0") Object callGroovyObjectGetPropertySafe(Object receiver) throws Throwable
      Reads the named property through GroovyObject.getProperty(String), returning null when receiver is null.
      Parameters:
      receiver - the Groovy object whose property is read; may be null
      Returns:
      the property value, or null when receiver is null
      Throws:
      Throwable - when the read fails
    • call

      @GroovyABI(since="1.6.0") Object call(Object receiver, Object[] args) throws Throwable
      Invokes the named method on receiver with args.
      Parameters:
      receiver - the target of the call
      args - the arguments, in order
      Returns:
      the value returned by the method
      Throws:
      Throwable - when the call fails
    • call

      @GroovyABI(since="1.6.0") Object call(Object receiver) throws Throwable
      Invokes the named method on receiver with no arguments.
      Parameters:
      receiver - the target of the call
      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) throws Throwable
      Invokes the named method on receiver with one argument.
      Parameters:
      receiver - the target of the call
      arg1 - the only 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) throws Throwable
      Invokes the named method on receiver with two arguments.
      Parameters:
      receiver - the target of the call
      arg1 - the first argument
      arg2 - 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 on receiver with three arguments.
      Parameters:
      receiver - the target of the call
      arg1 - the first argument
      arg2 - the second argument
      arg3 - 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 on receiver with four arguments.
      Parameters:
      receiver - the target of the call
      arg1 - the first argument
      arg2 - the second argument
      arg3 - the third argument
      arg4 - the fourth argument
      Returns:
      the value returned by the method
      Throws:
      Throwable - when the call fails
    • callSafe

      @GroovyABI(since="1.6.0") Object callSafe(Object receiver, Object[] args) throws Throwable
      Invokes the named method on receiver with args, returning null when receiver is null.
      Parameters:
      receiver - the target of the call; may be null
      args - the arguments, in order
      Returns:
      the value returned by the method, or null when receiver is null
      Throws:
      Throwable - when the call fails
    • callSafe

      @GroovyABI(since="1.6.0") Object callSafe(Object receiver) throws Throwable
      Invokes the named method on receiver with no arguments, returning null when receiver is null.
      Parameters:
      receiver - the target of the call; may be null
      Returns:
      the value returned by the method, or null when receiver is null
      Throws:
      Throwable - when the call fails
    • callSafe

      @GroovyABI(since="1.6.0") Object callSafe(Object receiver, Object arg1) throws Throwable
      Invokes the named method on receiver with one argument, returning null when receiver is null.
      Parameters:
      receiver - the target of the call; may be null
      arg1 - the only argument
      Returns:
      the value returned by the method, or null when receiver is 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 on receiver with two arguments, returning null when receiver is null.
      Parameters:
      receiver - the target of the call; may be null
      arg1 - the first argument
      arg2 - the second argument
      Returns:
      the value returned by the method, or null when receiver is 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 on receiver with three arguments, returning null when receiver is null.
      Parameters:
      receiver - the target of the call; may be null
      arg1 - the first argument
      arg2 - the second argument
      arg3 - the third argument
      Returns:
      the value returned by the method, or null when receiver is 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 on receiver with four arguments, returning null when receiver is null.
      Parameters:
      receiver - the target of the call; may be null
      arg1 - the first argument
      arg2 - the second argument
      arg3 - the third argument
      arg4 - the fourth argument
      Returns:
      the value returned by the method, or null when receiver is null
      Throws:
      Throwable - when the call fails
    • callCurrent

      @GroovyABI(since="1.6.0") Object callCurrent(GroovyObject receiver, Object[] args) throws Throwable
      Invokes the named method on the current object with args.
      Parameters:
      receiver - the current Groovy object
      args - the arguments, in order
      Returns:
      the value returned by the method
      Throws:
      Throwable - when the call fails
    • callCurrent

      @GroovyABI(since="1.6.0") Object callCurrent(GroovyObject receiver) throws Throwable
      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

      @GroovyABI(since="1.6.0") Object callCurrent(GroovyObject receiver, Object arg1) throws Throwable
      Invokes the named method on the current object with one argument.
      Parameters:
      receiver - the current Groovy object
      arg1 - 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 object
      arg1 - the first argument
      arg2 - 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 object
      arg1 - the first argument
      arg2 - the second argument
      arg3 - 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 object
      arg1 - the first argument
      arg2 - the second argument
      arg3 - the third argument
      arg4 - the fourth 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[] args) throws Throwable
      Invokes the named static method on receiver with args.
      Parameters:
      receiver - the class that declares the method
      args - the arguments, in order
      Returns:
      the value returned by the method
      Throws:
      Throwable - when the call fails
    • callStatic

      @GroovyABI(since="1.6.0") Object callStatic(Class receiver) throws Throwable
      Invokes the named static method on receiver with no arguments.
      Parameters:
      receiver - the class that declares the method
      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) throws Throwable
      Invokes the named static method on receiver with one argument.
      Parameters:
      receiver - the class that declares the method
      arg1 - 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 on receiver with two arguments.
      Parameters:
      receiver - the class that declares the method
      arg1 - the first argument
      arg2 - 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 on receiver with three arguments.
      Parameters:
      receiver - the class that declares the method
      arg1 - the first argument
      arg2 - the second argument
      arg3 - 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 on receiver with four arguments.
      Parameters:
      receiver - the class that declares the method
      arg1 - the first argument
      arg2 - the second argument
      arg3 - the third argument
      arg4 - the fourth argument
      Returns:
      the value returned by the method
      Throws:
      Throwable - when the call fails
    • callConstructor

      @GroovyABI(since="1.6.0") Object callConstructor(Object receiver, Object[] args) throws Throwable
      Invokes a constructor selected for receiver with args.
      Parameters:
      receiver - the constructor's owner, as supplied by the caller
      args - the constructor arguments, in order
      Returns:
      the constructed object
      Throws:
      Throwable - when construction fails
    • callConstructor

      @GroovyABI(since="1.6.0") Object callConstructor(Object receiver) throws Throwable
      Invokes a constructor selected for receiver with no arguments.
      Parameters:
      receiver - the constructor's owner, as supplied by the caller
      Returns:
      the constructed object
      Throws:
      Throwable - when construction fails
    • callConstructor

      @GroovyABI(since="1.6.0") Object callConstructor(Object receiver, Object arg1) throws Throwable
      Invokes a constructor selected for receiver with one argument.
      Parameters:
      receiver - the constructor's owner, as supplied by the caller
      arg1 - 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 for receiver with two arguments.
      Parameters:
      receiver - the constructor's owner, as supplied by the caller
      arg1 - the first constructor argument
      arg2 - 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 for receiver with three arguments.
      Parameters:
      receiver - the constructor's owner, as supplied by the caller
      arg1 - the first constructor argument
      arg2 - the second constructor argument
      arg3 - 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 for receiver with four arguments.
      Parameters:
      receiver - the constructor's owner, as supplied by the caller
      arg1 - the first constructor argument
      arg2 - the second constructor argument
      arg3 - the third constructor argument
      arg4 - the fourth constructor argument
      Returns:
      the constructed object
      Throws:
      Throwable - when construction fails