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 {
47 this.m = m;
48 }
49
50
51
52
53
54
55 public Class getType(FacesContext context) throws MethodNotFoundException
56 {
57 try
58 {
59 return m.getMethodInfo(context.getELContext()).getReturnType();
60 }
61 catch (javax.el.MethodNotFoundException e)
62 {
63 throw new MethodNotFoundException(e.getMessage(), e.getCause());
64 }
65 catch (ELException e)
66 {
67 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 return m.invoke(context.getELContext(), params);
83 }
84 catch (javax.el.MethodNotFoundException e)
85 {
86 throw new MethodNotFoundException(e.getMessage(), e.getCause());
87 }
88 catch (ELException e)
89 {
90 throw new EvaluationException(e.getMessage(), e.getCause());
91 }
92 }
93
94 public String getExpressionString()
95 {
96 return m.getExpressionString();
97 }
98 }