1 /** 2 * 3 */ 4 package test.crispy.example.modify; 5 6 import net.sf.crispy.InterceptorContext; 7 import net.sf.crispy.Modifier; 8 9 /** 10 * @author Linke 11 * 12 */ 13 public class EchoModifierBefore implements Modifier { 14 15 public static final String NEW_ECHO_STRING_BEFORE = "new echo string before"; 16 /** 17 * @see net.sf.crispy.Modifier#modifyBeforeInvocation(net.sf.crispy.InterceptorContext) 18 */ 19 public InterceptorContext modifyBeforeInvocation(InterceptorContext pvInterceptorContext) { 20 String lvMethodName = pvInterceptorContext.getMethod().getName(); 21 if (lvMethodName.equals("echo")) { 22 pvInterceptorContext.setArgs(new String[]{NEW_ECHO_STRING_BEFORE}); 23 } 24 return pvInterceptorContext; 25 } 26 27 /** 28 * @see net.sf.crispy.Modifier#modifyAfterInvocation(net.sf.crispy.InterceptorContext) 29 */ 30 public InterceptorContext modifyAfterInvocation(InterceptorContext pvInterceptorContext) { 31 return pvInterceptorContext; 32 } 33 34 }