1 4 5 42 43 45 package org.apache.cocoon.faces.samples.components.renderkit; 46 47 import javax.faces.component.StateHolder; 48 import javax.faces.context.FacesContext; 49 import javax.faces.el.MethodBinding; 50 51 public class ConstantMethodBinding extends MethodBinding 52 implements StateHolder { 53 54 private String outcome = null; 55 56 57 public ConstantMethodBinding() { 58 } 59 60 61 public ConstantMethodBinding(String yourOutcome) { 62 outcome = yourOutcome; 63 } 64 65 66 public Object invoke(FacesContext context, Object params[]) { 67 return outcome; 68 } 69 70 71 public Class getType(FacesContext context) { 72 return String .class; 73 } 74 75 77 public Object saveState(FacesContext context) { 78 return outcome; 79 } 80 81 82 public void restoreState(FacesContext context, Object state) { 83 outcome = (String ) state; 84 } 85 86 87 private boolean transientFlag = false; 88 89 90 public boolean isTransient() { 91 return (this.transientFlag); 92 } 93 94 95 public void setTransient(boolean transientFlag) { 96 this.transientFlag = transientFlag; 97 } 98 } 99 | Popular Tags |