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 ObjectgetAdaptee()ObjectinvokeMethod(String name, Object args)Invokes the given method.Iteratoriterator()voidsetAdaptee(Object adaptee)Proxywrap(Object adaptee)This method is for convenience.
-
Constructor Details
-
Proxy
public Proxy()
-
-
Method Details
-
wrap
This method is for convenience. It allows to get around the need for defining dump ctors in subclasses. See unit tests for details. -
getAdaptee
-
setAdaptee
-
invokeMethod
Description copied from interface:GroovyObjectInvokes the given method.- Parameters:
name- the name of the method to callargs- the arguments to use for the method call- Returns:
- the result of invoking the method
-
iterator
-