Package groovy.lang

Class DelegatingMetaClass

java.lang.Object
groovy.lang.DelegatingMetaClass
All Implemented Interfaces:
GroovyObject, MetaClass, MetaObjectProtocol, MutableMetaClass
Direct Known Subclasses:
HandleMetaClass, OwnedMetaClass

public class DelegatingMetaClass
extends java.lang.Object
implements MetaClass, MutableMetaClass, GroovyObject
  • Field Summary

    Fields
    Modifier and Type Field Description
    protected MetaClass delegate  
  • Constructor Summary

    Constructors
    Constructor Description
    DelegatingMetaClass​(MetaClass delegate)  
    DelegatingMetaClass​(java.lang.Class theClass)  
  • Method Summary

    Modifier and Type Method Description
    void addMetaBeanProperty​(MetaBeanProperty metaBeanProperty)
    Adds a new MetaBeanProperty to the MetaClass
    void addMetaMethod​(MetaMethod metaMethod)
    Adds a new MetaMethod to the MetaClass
    void addNewInstanceMethod​(java.lang.reflect.Method method)
    adds a new instance method to this MetaClass.
    void addNewStaticMethod​(java.lang.reflect.Method method)
    adds a new static method to this MetaClass.
    boolean equals​(java.lang.Object obj)  
    MetaClass getAdaptee()  
    java.lang.Object getAttribute​(java.lang.Class sender, java.lang.Object receiver, java.lang.String messageName, boolean useSuper)
    Retrieves the value of an attribute (field).
    java.lang.Object getAttribute​(java.lang.Object object, java.lang.String attribute)
    Retrieves an attribute of an instance of the class returned by the getTheClass() method.
    ClassNode getClassNode()
    Obtains a reference to the original AST for the MetaClass if it is available at runtime
    MetaClass getMetaClass()
    Returns the metaclass for a given class.
    MetaMethod getMetaMethod​(java.lang.String name, java.lang.Object[] args)
    Retrieves an instance MetaMethod for the given name and argument values, using the types of the argument values to establish the chosen MetaMethod
    java.util.List<MetaMethod> getMetaMethods()
    Retrieves a list of MetaMethods held by this class.
    MetaProperty getMetaProperty​(java.lang.String name)
    Returns a MetaProperty for the given name or null if it doesn't exist
    java.util.List<MetaMethod> getMethods()
    Retrieves a list of MetaMethods held by the class.
    java.util.List<MetaProperty> getProperties()
    Retrieves a list of MetaProperty instances that the MetaClass has
    java.lang.Object getProperty​(java.lang.Class sender, java.lang.Object receiver, java.lang.String messageName, boolean useSuper, boolean fromInsideClass)
    Retrieves a property on the given receiver for the specified arguments.
    java.lang.Object getProperty​(java.lang.Object object, java.lang.String property)
    Retrieves a property of an instance of the class returned by the getTheClass() method.
    java.lang.Object getProperty​(java.lang.String property)
    Retrieves a property value.
    MetaMethod getStaticMetaMethod​(java.lang.String name, java.lang.Class[] argTypes)  
    MetaMethod getStaticMetaMethod​(java.lang.String name, java.lang.Object[] args)
    Retrieves a static MetaMethod for the given name and argument values, using the types of the arguments to establish the chosen MetaMethod
    java.lang.Class getTheClass()
    Retrieves that Java Class that the attached Meta behaviours apply to
    int hashCode()  
    MetaProperty hasProperty​(java.lang.Object obj, java.lang.String name)
    Returns true of the implementing MetaClass has a property of the given name
    void initialize()
    Complete the initialisation process.
    java.lang.Object invokeConstructor​(java.lang.Object[] arguments)
    Invokes a constructor for the given arguments.
    java.lang.Object invokeMethod​(java.lang.Class sender, java.lang.Object receiver, java.lang.String methodName, java.lang.Object[] arguments, boolean isCallToSuper, boolean fromInsideClass)
    Invokes a method on the given receiver for the specified arguments.
    java.lang.Object invokeMethod​(java.lang.Object object, java.lang.String methodName, java.lang.Object arguments)
    Invokes a method on the given object, with the given name and single argument.
    java.lang.Object invokeMethod​(java.lang.Object object, java.lang.String methodName, java.lang.Object[] arguments)
    Invokes a method on the given Object with the given name and arguments.
    java.lang.Object invokeMethod​(java.lang.String name, java.lang.Object args)
    Invokes the given method.
    java.lang.Object invokeMissingMethod​(java.lang.Object instance, java.lang.String methodName, java.lang.Object[] arguments)
    Attempts to invoke the methodMissing method otherwise throws a MissingMethodException
    java.lang.Object invokeMissingProperty​(java.lang.Object instance, java.lang.String propertyName, java.lang.Object optionalValue, boolean isGetter)
    Invokes the propertyMissing method otherwise throws a MissingPropertyException
    java.lang.Object invokeStaticMethod​(java.lang.Object object, java.lang.String methodName, java.lang.Object[] arguments)
    Invokes a static method on the given Object with the given name and arguments.
    boolean isGroovyObject()  
    boolean isModified()
    Return whether the MetaClass has been modified or not
    MetaMethod pickMethod​(java.lang.String methodName, java.lang.Class[] arguments)
    Deprecated. 
    java.util.List<MetaMethod> respondsTo​(java.lang.Object obj, java.lang.String name)
    Returns an object satisfying Groovy truth if the implementing MetaClass responds to a method with the given name regardless of arguments.
    java.util.List<MetaMethod> respondsTo​(java.lang.Object obj, java.lang.String name, java.lang.Object[] argTypes)
    Returns an object satisfying Groovy truth if the implementing MetaClass responds to a method with the given name and arguments types.
    int selectConstructorAndTransformArguments​(int numberOfConstructors, java.lang.Object[] arguments)
    Internal method to support Groovy runtime.
    void setAdaptee​(MetaClass adaptee)  
    void setAttribute​(java.lang.Class sender, java.lang.Object receiver, java.lang.String messageName, java.lang.Object messageValue, boolean useSuper, boolean fromInsideClass)
    Sets the value of an attribute (field).
    void setAttribute​(java.lang.Object object, java.lang.String attribute, java.lang.Object newValue)
    Sets an attribute of an instance of the class returned by the getTheClass() method.
    void setMetaClass​(MetaClass metaClass)
    Allows the MetaClass to be replaced with a derived implementation.
    void setProperty​(java.lang.Class sender, java.lang.Object receiver, java.lang.String messageName, java.lang.Object messageValue, boolean useSuper, boolean fromInsideClass)
    Sets a property on the given receiver for the specified arguments.
    void setProperty​(java.lang.Object object, java.lang.String property, java.lang.Object newValue)
    Sets a property of an instance of the class returned by the getTheClass() method.
    void setProperty​(java.lang.String property, java.lang.Object newValue)
    Sets the given property to the new value.
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • DelegatingMetaClass

      public DelegatingMetaClass​(MetaClass delegate)
    • DelegatingMetaClass

      public DelegatingMetaClass​(java.lang.Class theClass)
  • Method Details

    • isModified

      public boolean isModified()
      Description copied from interface: MutableMetaClass
      Return whether the MetaClass has been modified or not
      Specified by:
      isModified in interface MutableMetaClass
      Returns:
      True if it has
    • addNewInstanceMethod

      public void addNewInstanceMethod​(java.lang.reflect.Method method)
      Description copied from interface: MutableMetaClass
      adds a new instance method to this MetaClass. Instance methods are able to overwrite the original methods of the class. Calling this method should not be done after initialise was called.
      Specified by:
      addNewInstanceMethod in interface MutableMetaClass
      Parameters:
      method - the method to be added
    • addNewStaticMethod

      public void addNewStaticMethod​(java.lang.reflect.Method method)
      Description copied from interface: MutableMetaClass
      adds a new static method to this MetaClass. This is only possible as long as initialise was not called.
      Specified by:
      addNewStaticMethod in interface MutableMetaClass
      Parameters:
      method - the method to be added
    • addMetaMethod

      public void addMetaMethod​(MetaMethod metaMethod)
      Description copied from interface: MutableMetaClass
      Adds a new MetaMethod to the MetaClass
      Specified by:
      addMetaMethod in interface MutableMetaClass
      Parameters:
      metaMethod - The MetaMethod to add
    • addMetaBeanProperty

      public void addMetaBeanProperty​(MetaBeanProperty metaBeanProperty)
      Description copied from interface: MutableMetaClass
      Adds a new MetaBeanProperty to the MetaClass
      Specified by:
      addMetaBeanProperty in interface MutableMetaClass
      Parameters:
      metaBeanProperty - The MetaBeanProperty instance
    • initialize

      public void initialize()
      Description copied from interface: MetaClass
      Complete the initialisation process. After this method is called no methods should be added to the meta class. Invocation of methods or access to fields/properties is forbidden unless this method is called. This method should contain any initialisation code, taking a longer time to complete. An example is the creation of the Reflector. It is suggested to synchronize this method.
      Specified by:
      initialize in interface MetaClass
    • getAttribute

      public java.lang.Object getAttribute​(java.lang.Object object, java.lang.String attribute)
      Description copied from interface: MetaObjectProtocol
      Retrieves an attribute of an instance of the class returned by the getTheClass() method.

      What this means is largely down to the MetaClass implementation, however the default case would result in attempt to read a field of the instance.

      Specified by:
      getAttribute in interface MetaObjectProtocol
      Parameters:
      object - An instance of the class returned by the getTheClass() method
      attribute - The name of the attribute to retrieve the value for
      Returns:
      The attribute value
      See Also:
      MetaClassImpl
    • getClassNode

      public ClassNode getClassNode()
      Description copied from interface: MetaClass
      Obtains a reference to the original AST for the MetaClass if it is available at runtime
      Specified by:
      getClassNode in interface MetaClass
      Returns:
      The original AST or null if it cannot be returned
    • getMetaMethods

      public java.util.List<MetaMethod> getMetaMethods()
      Description copied from interface: MetaClass
      Retrieves a list of MetaMethods held by this class. This list includes MetaMethods added by groovy.lang.ExpandoMetaClass.
      Specified by:
      getMetaMethods in interface MetaClass
      Returns:
      A list of MetaMethods
    • getMethods

      public java.util.List<MetaMethod> getMethods()
      Description copied from interface: MetaClass
      Retrieves a list of MetaMethods held by the class. This list does not include MetaMethods added by groovy.lang.ExpandoMetaClass.
      Specified by:
      getMethods in interface MetaClass
      Specified by:
      getMethods in interface MetaObjectProtocol
      Returns:
      A list of MetaMethods
      See Also:
      MetaMethod
    • respondsTo

      public java.util.List<MetaMethod> respondsTo​(java.lang.Object obj, java.lang.String name, java.lang.Object[] argTypes)
      Description copied from interface: MetaObjectProtocol

      Returns an object satisfying Groovy truth if the implementing MetaClass responds to a method with the given name and arguments types.

      Note that this method's return value is based on realised methods and does not take into account objects or classes that implement invokeMethod or methodMissing

      This method is "safe" in that it will always return a value and never throw an exception

      Specified by:
      respondsTo in interface MetaObjectProtocol
      Parameters:
      obj - The object to inspect
      name - The name of the method of interest
      argTypes - The argument types to match against
      Returns:
      A List of MetaMethods matching the argument types which will be empty if no matching methods exist
    • respondsTo

      public java.util.List<MetaMethod> respondsTo​(java.lang.Object obj, java.lang.String name)
      Description copied from interface: MetaObjectProtocol

      Returns an object satisfying Groovy truth if the implementing MetaClass responds to a method with the given name regardless of arguments. In other words this method will return for foo() and foo(String).

      Note that this method's return value is based on realised methods and does not take into account objects or classes that implement invokeMethod or methodMissing

      This method is "safe" in that it will always return a value and never throw an exception

      Specified by:
      respondsTo in interface MetaObjectProtocol
      Parameters:
      obj - The object to inspect
      name - The name of the method of interest
      Returns:
      A List of MetaMethods which will be empty if no methods with the given name exist
    • hasProperty

      public MetaProperty hasProperty​(java.lang.Object obj, java.lang.String name)
      Description copied from interface: MetaObjectProtocol

      Returns true of the implementing MetaClass has a property of the given name

      Note that this method will only return true for realised properties and does not take into account implementation of getProperty or propertyMissing

      Specified by:
      hasProperty in interface MetaObjectProtocol
      Parameters:
      obj - The object to inspect
      name - The name of the property
      Returns:
      The MetaProperty or null if it doesn't exist
    • getProperties

      public java.util.List<MetaProperty> getProperties()
      Description copied from interface: MetaClass
      Retrieves a list of MetaProperty instances that the MetaClass has
      Specified by:
      getProperties in interface MetaClass
      Specified by:
      getProperties in interface MetaObjectProtocol
      Returns:
      A list of MetaProperty instances
      See Also:
      MetaProperty
    • getProperty

      public java.lang.Object getProperty​(java.lang.Object object, java.lang.String property)
      Description copied from interface: MetaObjectProtocol
      Retrieves a property of an instance of the class returned by the getTheClass() method.

      What this means is largely down to the MetaClass implementation, however the default case would result in an attempt to invoke a JavaBean getter, or if no such getter exists a public field of the instance.

      Specified by:
      getProperty in interface MetaObjectProtocol
      Parameters:
      object - An instance of the class returned by the getTheClass() method
      property - The name of the property to retrieve the value for
      Returns:
      The properties value
      See Also:
      MetaClassImpl
    • invokeConstructor

      public java.lang.Object invokeConstructor​(java.lang.Object[] arguments)
      Description copied from interface: MetaObjectProtocol
      Invokes a constructor for the given arguments. The MetaClass will attempt to pick the best argument which matches the types of the objects passed within the arguments array
      Specified by:
      invokeConstructor in interface MetaObjectProtocol
      Parameters:
      arguments - The arguments to the constructor
      Returns:
      An instance of the java.lang.Class that this MetaObjectProtocol object applies to
    • invokeMethod

      public java.lang.Object invokeMethod​(java.lang.Object object, java.lang.String methodName, java.lang.Object arguments)
      Description copied from interface: MetaObjectProtocol
      Invokes a method on the given object, with the given name and single argument.
      Specified by:
      invokeMethod in interface MetaObjectProtocol
      Parameters:
      object - The Object to invoke the method on
      methodName - The name of the method
      arguments - The argument to the method
      Returns:
      The return value of the method which is null if the return type is void
      See Also:
      MetaObjectProtocol.invokeMethod(Object, String, Object[])
    • invokeMethod

      public java.lang.Object invokeMethod​(java.lang.Object object, java.lang.String methodName, java.lang.Object[] arguments)
      Description copied from interface: MetaObjectProtocol
      Invokes a method on the given Object with the given name and arguments. The MetaClass will attempt to pick the best method for the given name and arguments. If a method cannot be invoked a MissingMethodException will be thrown.
      Specified by:
      invokeMethod in interface MetaObjectProtocol
      Parameters:
      object - The instance which the method is invoked on
      methodName - The name of the method
      arguments - The arguments to the method
      Returns:
      The return value of the method which is null if the return type is void
      See Also:
      MissingMethodException
    • invokeStaticMethod

      public java.lang.Object invokeStaticMethod​(java.lang.Object object, java.lang.String methodName, java.lang.Object[] arguments)
      Description copied from interface: MetaObjectProtocol
      Invokes a static method on the given Object with the given name and arguments.

      The Object can either be an instance of the class that this MetaObjectProtocol instance applies to or the java.lang.Class instance itself. If a method cannot be invoked a MissingMethodException is will be thrown

      Specified by:
      invokeStaticMethod in interface MetaObjectProtocol
      Parameters:
      object - An instance of the class returned by the getTheClass() method or the class itself
      methodName - The name of the method
      arguments - The arguments to the method
      Returns:
      The return value of the method which is null if the return type is void
      See Also:
      MissingMethodException
    • setAttribute

      public void setAttribute​(java.lang.Object object, java.lang.String attribute, java.lang.Object newValue)
      Description copied from interface: MetaObjectProtocol
      Sets an attribute of an instance of the class returned by the getTheClass() method.

      What this means is largely down to the MetaClass implementation, however the default case would result in an attempt to set a field of the instance.

      Specified by:
      setAttribute in interface MetaObjectProtocol
      Parameters:
      object - An instance of the class returned by the getTheClass() method
      attribute - The name of the attribute to set
      newValue - The new value of the attribute
      See Also:
      MetaClassImpl
    • setProperty

      public void setProperty​(java.lang.Object object, java.lang.String property, java.lang.Object newValue)
      Description copied from interface: MetaObjectProtocol
      Sets a property of an instance of the class returned by the getTheClass() method.

      What this means is largely down to the MetaClass implementation, however the default case would result in an attempt to invoke a JavaBean setter, or if no such setter exists to set a public field of the instance.

      Specified by:
      setProperty in interface MetaObjectProtocol
      Parameters:
      object - An instance of the class returned by the getTheClass() method
      property - The name of the property to set
      newValue - The new value of the property
      See Also:
      MetaClassImpl
    • equals

      public boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • pickMethod

      @Deprecated public MetaMethod pickMethod​(java.lang.String methodName, java.lang.Class[] arguments)
      Deprecated.
      Description copied from interface: MetaClass
      Selects a method by name and argument classes. This method does not search for an exact match, it searches for a compatible method. For this the method selection mechanism is used as provided by the implementation of this MetaClass. pickMethod may or may not be used during the method selection process when invoking a method. There is no warranty for that.
      Specified by:
      pickMethod in interface MetaClass
      Parameters:
      methodName - the name of the method to pick
      arguments - the method arguments
      Returns:
      a matching MetaMethod or null
    • getAttribute

      public java.lang.Object getAttribute​(java.lang.Class sender, java.lang.Object receiver, java.lang.String messageName, boolean useSuper)
      Description copied from interface: MetaClass
      Retrieves the value of an attribute (field). This method is to support the Groovy runtime and not for general client API usage.
      Specified by:
      getAttribute in interface MetaClass
      Parameters:
      sender - The class of the object that requested the attribute
      receiver - The instance
      messageName - The name of the attribute
      useSuper - Whether to look-up on the super class or not
      Returns:
      The attribute value
    • getProperty

      public java.lang.Object getProperty​(java.lang.Class sender, java.lang.Object receiver, java.lang.String messageName, boolean useSuper, boolean fromInsideClass)
      Description copied from interface: MetaClass

      Retrieves a property on the given receiver for the specified arguments. The sender is the class that is requesting the property from the object. The MetaClass will attempt to establish the method to invoke based on the name and arguments provided.

      The isCallToSuper and fromInsideClass help the Groovy runtime perform optimisations on the call to go directly to the super class if necessary

      Specified by:
      getProperty in interface MetaClass
      Parameters:
      sender - The java.lang.Class instance that requested the property
      receiver - The Object which the property is being retrieved from
      messageName - The name of the property
      useSuper - Whether the call is to a super class property
      fromInsideClass - ??
      Returns:
      The properties value
    • getMetaProperty

      public MetaProperty getMetaProperty​(java.lang.String name)
      Description copied from interface: MetaObjectProtocol
      Returns a MetaProperty for the given name or null if it doesn't exist
      Specified by:
      getMetaProperty in interface MetaObjectProtocol
      Parameters:
      name - The name of the MetaProperty
      Returns:
      A MetaProperty or null
    • getStaticMetaMethod

      public MetaMethod getStaticMetaMethod​(java.lang.String name, java.lang.Object[] args)
      Description copied from interface: MetaObjectProtocol
      Retrieves a static MetaMethod for the given name and argument values, using the types of the arguments to establish the chosen MetaMethod
      Specified by:
      getStaticMetaMethod in interface MetaObjectProtocol
      Parameters:
      name - The name of the MetaMethod
      args - The argument types
      Returns:
      A MetaMethod or null if it doesn't exist
    • getStaticMetaMethod

      public MetaMethod getStaticMetaMethod​(java.lang.String name, java.lang.Class[] argTypes)
    • getMetaMethod

      public MetaMethod getMetaMethod​(java.lang.String name, java.lang.Object[] args)
      Description copied from interface: MetaObjectProtocol
      Retrieves an instance MetaMethod for the given name and argument values, using the types of the argument values to establish the chosen MetaMethod
      Specified by:
      getMetaMethod in interface MetaObjectProtocol
      Parameters:
      name - The name of the MetaMethod
      args - Array containing - 1) the argument values (using which their types are then inferred), or 2) the corresponding argument types
      Returns:
      A MetaMethod or null if it doesn't exist
    • getTheClass

      public java.lang.Class getTheClass()
      Description copied from interface: MetaObjectProtocol
      Retrieves that Java Class that the attached Meta behaviours apply to
      Specified by:
      getTheClass in interface MetaObjectProtocol
      Returns:
      The java.lang.Class instance
    • invokeMethod

      public java.lang.Object invokeMethod​(java.lang.Class sender, java.lang.Object receiver, java.lang.String methodName, java.lang.Object[] arguments, boolean isCallToSuper, boolean fromInsideClass)
      Description copied from interface: MetaClass

      Invokes a method on the given receiver for the specified arguments. The sender is the class that invoked the method on the object. The MetaClass will attempt to establish the method to invoke based on the name and arguments provided.

      The isCallToSuper and fromInsideClass help the Groovy runtime perform optimisations on the call to go directly to the super class if necessary

      Specified by:
      invokeMethod in interface MetaClass
      Parameters:
      sender - The java.lang.Class instance that invoked the method
      receiver - The object which the method was invoked on
      methodName - The name of the method
      arguments - The arguments to the method
      isCallToSuper - Whether the method is a call to a super class method
      fromInsideClass - Whether the call was invoked from the inside or the outside of the class
      Returns:
      The return value of the method
    • invokeMissingMethod

      public java.lang.Object invokeMissingMethod​(java.lang.Object instance, java.lang.String methodName, java.lang.Object[] arguments)
      Description copied from interface: MetaClass

      Attempts to invoke the methodMissing method otherwise throws a MissingMethodException

      Specified by:
      invokeMissingMethod in interface MetaClass
      Parameters:
      instance - The instance to invoke methodMissing on
      methodName - The name of the method
      arguments - The arguments to the method
      Returns:
      The results of methodMissing or throws MissingMethodException
      See Also:
      MissingMethodException
    • invokeMissingProperty

      public java.lang.Object invokeMissingProperty​(java.lang.Object instance, java.lang.String propertyName, java.lang.Object optionalValue, boolean isGetter)
      Description copied from interface: MetaClass
      Invokes the propertyMissing method otherwise throws a MissingPropertyException
      Specified by:
      invokeMissingProperty in interface MetaClass
      Parameters:
      instance - The instance of the class
      propertyName - The name of the property
      optionalValue - The value of the property which could be null in the case of a getter
      isGetter - Whether the missing property event was the result of a getter or a setter
      Returns:
      The result of the propertyMissing method or throws MissingPropertyException
    • isGroovyObject

      public boolean isGroovyObject()
    • setAttribute

      public void setAttribute​(java.lang.Class sender, java.lang.Object receiver, java.lang.String messageName, java.lang.Object messageValue, boolean useSuper, boolean fromInsideClass)
      Description copied from interface: MetaClass
      Sets the value of an attribute (field). This method is to support the Groovy runtime and not for general client API usage.
      Specified by:
      setAttribute in interface MetaClass
      Parameters:
      sender - The class of the object that requested the attribute
      receiver - The instance
      messageName - The name of the attribute
      messageValue - The value of the attribute
      useSuper - Whether to look-up on the super class or not
      fromInsideClass - Whether the call happened from the inside or the outside of a class
    • setProperty

      public void setProperty​(java.lang.Class sender, java.lang.Object receiver, java.lang.String messageName, java.lang.Object messageValue, boolean useSuper, boolean fromInsideClass)
      Description copied from interface: MetaClass

      Sets a property on the given receiver for the specified arguments. The sender is the class that is setting the property from the object. The MetaClass will attempt to establish the method to invoke based on the name and arguments provided.

      The isCallToSuper and fromInsideClass help the Groovy runtime perform optimisations on the call to go directly to the super class if necessary

      Specified by:
      setProperty in interface MetaClass
      Parameters:
      sender - The java.lang.Class instance that is mutating the property
      receiver - The Object which the property is being set on
      messageName - The name of the property
      messageValue - The new value of the property to set
      useSuper - Whether the call is to a super class property
      fromInsideClass - Whether the call was invoked from the inside or the outside of the class
    • selectConstructorAndTransformArguments

      public int selectConstructorAndTransformArguments​(int numberOfConstructors, java.lang.Object[] arguments)
      Description copied from interface: MetaClass
      Internal method to support Groovy runtime. Not for client usage.
      Specified by:
      selectConstructorAndTransformArguments in interface MetaClass
      Parameters:
      numberOfConstructors - The number of constructors
      arguments - The arguments
      Returns:
      selected index
    • setAdaptee

      public void setAdaptee​(MetaClass adaptee)
    • getAdaptee

      public MetaClass getAdaptee()
    • invokeMethod

      public java.lang.Object invokeMethod​(java.lang.String name, java.lang.Object args)
      Description copied from interface: GroovyObject
      Invokes the given method.
      Specified by:
      invokeMethod in interface GroovyObject
      Parameters:
      name - the name of the method to call
      args - the arguments to use for the method call
      Returns:
      the result of invoking the method
    • getProperty

      public java.lang.Object getProperty​(java.lang.String property)
      Description copied from interface: GroovyObject
      Retrieves a property value.
      Specified by:
      getProperty in interface GroovyObject
      Parameters:
      property - the name of the property of interest
      Returns:
      the given property
    • setProperty

      public void setProperty​(java.lang.String property, java.lang.Object newValue)
      Description copied from interface: GroovyObject
      Sets the given property to the new value.
      Specified by:
      setProperty in interface GroovyObject
      Parameters:
      property - the name of the property of interest
      newValue - the new value for the property
    • getMetaClass

      public MetaClass getMetaClass()
      Description copied from interface: GroovyObject
      Returns the metaclass for a given class.
      Specified by:
      getMetaClass in interface GroovyObject
      Returns:
      the metaClass of this instance
    • setMetaClass

      public void setMetaClass​(MetaClass metaClass)
      Description copied from interface: GroovyObject
      Allows the MetaClass to be replaced with a derived implementation.
      Specified by:
      setMetaClass in interface GroovyObject
      Parameters:
      metaClass - the new metaclass