View Javadoc

1   package net.sf.crispy.impl.caucho;
2   
3   import net.sf.crispy.InterceptorContext;
4   import net.sf.crispy.InvocationException;
5   import net.sf.crispy.Modifier;
6   import net.sf.crispy.util.Converter;
7   
8   public class ConverterModifier implements Modifier {
9   
10  
11  	public InterceptorContext modifyBeforeInvocation(InterceptorContext pvInterceptorContext) {
12  //		Object args[] = pvInterceptorContext.getArgs();
13  //		Converter lvConverter = new Converter();
14  //		for (int i = 0; i < args.length; i++) {
15  //			try {
16  //				args[i] = lvConverter.makeSimple(args[i]);
17  //			} catch (Exception e) {
18  //				e.printStackTrace();
19  //			}
20  //		}
21  //		pvInterceptorContext.setArgs(args);
22  		return pvInterceptorContext;
23  	}
24  
25  	public InterceptorContext modifyAfterInvocation(InterceptorContext pvInterceptorContext) {
26  		Object lvResult = pvInterceptorContext.getResult();
27  		try {
28  			lvResult = new Converter().makeComplex(lvResult);
29  		} catch (Exception e) {
30  			throw new InvocationException("Exception in ConverterModifier in modifyAfterInvocation: " + e, e);
31  		}
32  		pvInterceptorContext.setResult(lvResult);
33  		return pvInterceptorContext;
34  	}
35  
36  }