Groovy Documentation

org.codehaus.groovy.grails.commons.metaclass
[Java] Interface PropertyAccessInterceptor

org.codehaus.groovy.grails.commons.metaclass.Interceptor
  org.codehaus.groovy.grails.commons.metaclass.PropertyAccessInterceptor
All Superinterfaces:
Interceptor

public interface PropertyAccessInterceptor
extends Interceptor

Adds the ability to intercept property getters/setters.

Authors:
Graeme Rocher


Method Summary
java.lang.Object beforeGet(java.lang.Object object, java.lang.String property, InvocationCallback callback)

Intercepts a getXXX call and returns a result.

void beforeSet(java.lang.Object object, java.lang.String property, java.lang.Object newValue, InvocationCallback callback)

Intercepts a setXXX call.

 
Methods inherited from interface Interceptor
afterInvoke, beforeInvoke
 

Method Detail

beforeGet

public java.lang.Object beforeGet(java.lang.Object object, java.lang.String property, InvocationCallback callback)
Intercepts a getXXX call and returns a result. The result is replaced by the real value if doGet() return false
Parameters:
object - The target object
property - The property to get
callback - The callback object
Returns:
A value supplied by the interceptor


beforeSet

public void beforeSet(java.lang.Object object, java.lang.String property, java.lang.Object newValue, InvocationCallback callback)
Intercepts a setXXX call.
Parameters:
object - The target object
property - The property to set
newValue - The new value
callback - The callback object


 

Groovy Documentation