1 16 package org.apache.myfaces.wap.base; 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 32 public class ConstantMethodBinding extends MethodBinding implements StateHolder { 33 private String outCome; 34 private boolean _transient; 35 36 37 public ConstantMethodBinding() { 38 } 39 40 public ConstantMethodBinding(String outCome) { 41 this.outCome = outCome; 42 } 43 44 public Class getType(FacesContext facesContext) throws MethodNotFoundException { 45 return(String .class); 46 } 47 48 public Object invoke(FacesContext facesContext, Object [] obj) throws EvaluationException, MethodNotFoundException { 49 return(outCome); 50 } 51 52 53 public void restoreState(FacesContext facesContext, Object obj) { 54 this.outCome = (String )obj; 55 } 56 57 public Object saveState(FacesContext facesContext) { 58 return(outCome); 59 } 60 61 public boolean isTransient() { 62 return _transient; 63 } 64 65 public void setTransient(boolean _transient) { 66 this._transient = _transient; 67 } 68 } 69 | Popular Tags |