package com.blogspot.diegopacheco.groovy.interceptor import org.codehaus.groovy.runtime.* /** * Interceptor de métodos do Groovy. * * @author Diego Pacheco * @since 17/02/2009 * @version 1.0 * */ public class GroovyInterceptor implements Interceptor{ Object beforeInvoke(Object object, String methodName, Object[] arguments){ println " BEFORE $object.$methodName($arguments)" null } boolean doInvoke(){ true } Object afterInvoke(Object object, String methodName, Object[] arguments,Object result){ println " AFTER $object.$methodName($arguments): $result" result } }