1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
package org.apache.myfaces.view.facelets.el; |
20 | |
|
21 | |
import java.io.Serializable; |
22 | |
|
23 | |
import javax.el.ELException; |
24 | |
import javax.el.MethodExpression; |
25 | |
import javax.faces.context.FacesContext; |
26 | |
import javax.faces.el.EvaluationException; |
27 | |
import javax.faces.el.MethodBinding; |
28 | |
import javax.faces.el.MethodNotFoundException; |
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
public final class LegacyMethodBinding extends MethodBinding implements |
38 | |
Serializable |
39 | |
{ |
40 | |
|
41 | |
private static final long serialVersionUID = 1L; |
42 | |
|
43 | |
private final MethodExpression m; |
44 | |
|
45 | |
public LegacyMethodBinding(MethodExpression m) |
46 | 0 | { |
47 | 0 | this.m = m; |
48 | 0 | } |
49 | |
|
50 | |
|
51 | |
|
52 | |
|
53 | |
|
54 | |
|
55 | |
public Class getType(FacesContext context) throws MethodNotFoundException |
56 | |
{ |
57 | |
try |
58 | |
{ |
59 | 0 | return m.getMethodInfo(context.getELContext()).getReturnType(); |
60 | |
} |
61 | 0 | catch (javax.el.MethodNotFoundException e) |
62 | |
{ |
63 | 0 | throw new MethodNotFoundException(e.getMessage(), e.getCause()); |
64 | |
} |
65 | 0 | catch (ELException e) |
66 | |
{ |
67 | 0 | throw new EvaluationException(e.getMessage(), e.getCause()); |
68 | |
} |
69 | |
} |
70 | |
|
71 | |
|
72 | |
|
73 | |
|
74 | |
|
75 | |
|
76 | |
|
77 | |
public Object invoke(FacesContext context, Object[] params) |
78 | |
throws EvaluationException, MethodNotFoundException |
79 | |
{ |
80 | |
try |
81 | |
{ |
82 | 0 | return m.invoke(context.getELContext(), params); |
83 | |
} |
84 | 0 | catch (javax.el.MethodNotFoundException e) |
85 | |
{ |
86 | 0 | throw new MethodNotFoundException(e.getMessage(), e.getCause()); |
87 | |
} |
88 | 0 | catch (ELException e) |
89 | |
{ |
90 | 0 | throw new EvaluationException(e.getMessage(), e.getCause()); |
91 | |
} |
92 | |
} |
93 | |
|
94 | |
public String getExpressionString() |
95 | |
{ |
96 | 0 | return m.getExpressionString(); |
97 | |
} |
98 | |
} |