|
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 |
1
| public InterceptorContext modifyBeforeInvocation(InterceptorContext pvInterceptorContext) {
|
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| |
|
16 |
| |
|
17 |
| |
|
18 |
| |
|
19 |
| |
|
20 |
| |
|
21 |
| |
|
22 |
1
| return pvInterceptorContext;
|
|
23 |
| } |
|
24 |
| |
|
25 |
2
| public InterceptorContext modifyAfterInvocation(InterceptorContext pvInterceptorContext) {
|
|
26 |
2
| Object lvResult = pvInterceptorContext.getResult();
|
|
27 |
2
| try {
|
|
28 |
2
| lvResult = new Converter().makeComplex(lvResult);
|
|
29 |
| } catch (Exception e) { |
|
30 |
1
| throw new InvocationException("Exception in ConverterModifier in modifyAfterInvocation: " + e, e);
|
|
31 |
| } |
|
32 |
1
| pvInterceptorContext.setResult(lvResult);
|
|
33 |
1
| return pvInterceptorContext;
|
|
34 |
| } |
|
35 |
| |
|
36 |
| } |