Package groovy.lang

Interface GroovyObject

    • Method Detail

      • invokeMethod

        default Object invokeMethod​(String name,
                                    Object args)
        Invokes the given method.
        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

        default Object getProperty​(String propertyName)
        Retrieves a property value.
        Parameters:
        propertyName - the name of the property of interest
        Returns:
        the given property
      • setProperty

        default void setProperty​(String propertyName,
                                 Object newValue)
        Sets the given property to the new value.
        Parameters:
        propertyName - the name of the property of interest
        newValue - the new value for the property
      • getMetaClass

        MetaClass getMetaClass()
        Returns the metaclass for a given class.
        Returns:
        the metaClass of this instance
      • setMetaClass

        void setMetaClass​(MetaClass metaClass)
        Allows the MetaClass to be replaced with a derived implementation.
        Parameters:
        metaClass - the new metaclass