Top Description Fields Constructors Methods
groovy.util

public Class Proxy

extends GroovyObjectSupport
Class Inheritance
Imports
groovy.lang.GroovyObjectSupport, .MissingMethodException, org.codehaus.groovy.runtime.InvokerHelper, java.util.Iterator

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.

Field Summary

Modifier and TypeField and Description
private Object

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
public Object
invokeMethod(String
the name of the method to call
name
,
Object
the arguments to use for the method call
args
)

Overrides default groovy.lang.GroovyObject.invokeMethod.

Invokes the given method.
public Iterator<E>
public void
setAdaptee(Object adaptee)

public Proxy
wrap(Object adaptee)

This method is for convenience.

Inherited from groovy.lang.GroovyObjectSupport:
getMetaClasssetMetaClass

Field Detail

adapteeback to summary
private Object adaptee

Constructor Detail

Proxyback to summary
public Proxy()

Method Detail

getAdapteeback to summary
public Object getAdaptee()
invokeMethodback to summary
public Object invokeMethod(String name, Object args)

Overrides default groovy.lang.GroovyObject.invokeMethod.

Doc from groovy.lang.GroovyObject.invokeMethod.

Invokes the given method.

Parameters
name:String

the name of the method to call

args:Object

the arguments to use for the method call

Returns:Object

the result of invoking the method

iteratorback to summary
public Iterator<E> iterator()
setAdapteeback to summary
public void setAdaptee(Object adaptee)
wrapback to summary
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.