1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.myfaces.shared.el;
20
21 import javax.faces.component.StateHolder;
22 import javax.faces.context.FacesContext;
23 import javax.faces.el.EvaluationException;
24 import javax.faces.el.MethodBinding;
25 import javax.faces.el.MethodNotFoundException;
26
27
28
29
30 public class SimpleActionMethodBinding
31 extends MethodBinding
32 implements StateHolder
33 {
34 private String _outcome;
35
36 public SimpleActionMethodBinding(String outcome)
37 {
38 _outcome = outcome;
39 }
40
41 public Object invoke(FacesContext facescontext, Object aobj[]) throws EvaluationException, MethodNotFoundException
42 {
43 return _outcome;
44 }
45
46 public Class getType(FacesContext facescontext) throws MethodNotFoundException
47 {
48 return String.class;
49 }
50
51
52
53
54 private boolean _transient = false;
55
56
57
58
59 public SimpleActionMethodBinding()
60 {
61 _outcome = null;
62 }
63
64 public Object saveState(FacesContext facescontext)
65 {
66 return _outcome;
67 }
68
69 public void restoreState(FacesContext facescontext, Object obj)
70 {
71 _outcome = (String)obj;
72 }
73
74 public boolean isTransient()
75 {
76 return _transient;
77 }
78
79 public void setTransient(boolean flag)
80 {
81 _transient = flag;
82 }
83
84 public String toString()
85 {
86 return _outcome;
87 }
88 }