Proxy (Groovy 5.0.0)
Description: declaration: package: groovy.util, class: Proxy

Package groovy.util

# Class Proxy

java.lang.Object
groovy.lang.GroovyObjectSupport
groovy.util.Proxy

All Implemented Interfaces:
  `GroovyObject`

public class Proxy extends GroovyObjectSupport
Dynamic groovy proxy for another object. All method invocations get forwarded to actual object, unless the proxy overrides it. See groovy/util/ProxyTest.groovy for usage details.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Proxy()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `getAdaptee()`
  `Object`
  `invokeMethod(String name, Object args)`
  Invokes the given method.
  `Iterator`
  `iterator()`
  `void`
  `setAdaptee(Object adaptee)`
  `Proxy`
  `wrap(Object adaptee)`
  This method is for convenience.

  ### Methods inherited from class groovy.lang.GroovyObjectSupport

  `getMetaClass, setMetaClass`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface groovy.lang.GroovyObject

  `getProperty, setProperty`

- ## Constructor Details

  - ### Proxy

    public Proxy()

- ## Method Details

  - ### wrap

    public Proxy wrap(Object adaptee)
    This method is for convenience. It allows to get around the need for defining dump ctors in subclasses. See unit tests for details.

  - ### getAdaptee

    public Object getAdaptee()

  - ### setAdaptee

    public void setAdaptee(Object adaptee)

  - ### invokeMethod

    public Object invokeMethod(String name, Object args)
    Description copied from interface: `GroovyObject`
    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

  - ### iterator

    public Iterator iterator()