1 16 package org.apache.myfaces.el; 17 18 import javax.faces.component.StateHolder; 19 import javax.faces.context.FacesContext; 20 import javax.faces.el.EvaluationException; 21 import javax.faces.el.MethodBinding; 22 import javax.faces.el.MethodNotFoundException; 23 24 28 public class SimpleActionMethodBinding 29 extends MethodBinding 30 implements StateHolder 31 { 32 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 54 private boolean _transient = false; 55 56 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 | Popular Tags |