1 3 4 package com.sun.j2ee.blueprints.catalog.validator; 5 6 import javax.faces.component.StateHolder; 7 import javax.faces.context.FacesContext; 8 import javax.faces.el.MethodBinding; 9 10 14 15 public class ConstantMethodBinding extends MethodBinding 16 implements StateHolder { 17 18 private String outcome = null; 19 20 23 public ConstantMethodBinding() { 24 25 } 26 27 30 public ConstantMethodBinding(String yourOutcome) { 31 outcome = yourOutcome; 32 } 33 34 39 public Object invoke(FacesContext context, Object params[]) { 40 return outcome; 41 } 42 43 47 public Class getType(FacesContext context) { 48 return String .class; 49 } 50 51 53 54 57 public Object saveState(FacesContext context) { 58 return outcome; 59 } 60 61 65 public void restoreState(FacesContext context, Object state) { 66 outcome = (String ) state; 67 } 68 69 private boolean transientFlag = false; 70 71 75 public boolean isTransient() { 76 return (this.transientFlag); 77 } 78 79 83 public void setTransient(boolean transientFlag) { 84 this.transientFlag = transientFlag; 85 } 86 87 } 88 89 | Popular Tags |