Top Description Methods
groovy.lang

public Interface Interceptor

Known Direct Subinterfaces
groovy.lang.PropertyAccessInterceptor
Known Direct Implementers
groovy.lang.TracingInterceptor, groovy.lang.BenchmarkInterceptor

Implementers of this interface can be registered in the ProxyMetaClass for notifications about method calls for objects managed by the ProxyMetaClass. See groovy/lang/InterceptorTest.groovy for details.

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

any arbitrary result that can replace the result of the original method call. Typically, the result parameter is returned.
afterInvoke
(Object
receiver object for the called method
object
,
String
name of the called method
methodName
,
Object[]
arguments to the called method
arguments
,
Object
result of the executed method call or result of beforeInvoke if method was not called
result
)

This code is executed after the method is optionally called.

public Object

Returns:

any arbitrary result that replaces the result of the original method call only if doInvoke() returns false and afterInvoke() relays this result.
beforeInvoke
(Object
receiver object for the method call
object
,
String
name of the method to call
methodName
,
Object[]
arguments to the method call
arguments
)

This code is executed before the method is optionally called.

public boolean

Returns:

whether the target method should be invoked at all.
doInvoke
()

Method Detail

afterInvokeback to summary
public Object afterInvoke(Object object, String methodName, Object[] arguments, Object result)

This code is executed after the method is optionally called.

Parameters
object:Object

receiver object for the called method

methodName:String

name of the called method

arguments:Object[]

arguments to the called method

result:Object

result of the executed method call or result of beforeInvoke if method was not called

Returns:Object

any arbitrary result that can replace the result of the original method call. Typically, the result parameter is returned.

beforeInvokeback to summary
public Object beforeInvoke(Object object, String methodName, Object[] arguments)

This code is executed before the method is optionally called.

Parameters
object:Object

receiver object for the method call

methodName:String

name of the method to call

arguments:Object[]

arguments to the method call

Returns:Object

any arbitrary result that replaces the result of the original method call only if doInvoke() returns false and afterInvoke() relays this result.

doInvokeback to summary
public boolean doInvoke()
Returns:boolean

whether the target method should be invoked at all.