| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.seasar.teeda.core.mock; |
| 17 | |
|
| 18 | |
import javax.faces.component.StateHolder; |
| 19 | |
import javax.faces.context.FacesContext; |
| 20 | |
import javax.faces.el.EvaluationException; |
| 21 | |
import javax.faces.el.PropertyNotFoundException; |
| 22 | |
import javax.faces.el.ValueBinding; |
| 23 | |
|
| 24 | |
public class MockValueBinding extends ValueBinding implements StateHolder { |
| 25 | |
|
| 26 | 953 | private Object obj_ = null; |
| 27 | |
|
| 28 | 953 | private boolean transientValue_ = false; |
| 29 | |
|
| 30 | 954 | private Class type_ = String.class; |
| 31 | |
|
| 32 | |
private String exprStr_; |
| 33 | |
|
| 34 | 934 | public MockValueBinding() { |
| 35 | 934 | } |
| 36 | |
|
| 37 | 19 | public MockValueBinding(String exprStr) { |
| 38 | 19 | setExpressionString(exprStr); |
| 39 | 19 | } |
| 40 | |
|
| 41 | |
public Object getValue(FacesContext context) throws EvaluationException, |
| 42 | |
PropertyNotFoundException { |
| 43 | 1325 | return obj_; |
| 44 | |
} |
| 45 | |
|
| 46 | |
public void setValue(FacesContext context, Object obj) |
| 47 | |
throws EvaluationException, PropertyNotFoundException { |
| 48 | 850 | obj_ = obj; |
| 49 | 850 | } |
| 50 | |
|
| 51 | |
public boolean isReadOnly(FacesContext context) throws EvaluationException, |
| 52 | |
PropertyNotFoundException { |
| 53 | 0 | return false; |
| 54 | |
} |
| 55 | |
|
| 56 | |
public Class getType(FacesContext context) throws EvaluationException, |
| 57 | |
PropertyNotFoundException { |
| 58 | 9 | return type_; |
| 59 | |
} |
| 60 | |
|
| 61 | |
public void setType(Class type) { |
| 62 | 10 | type_ = type; |
| 63 | 10 | } |
| 64 | |
|
| 65 | |
public boolean isTransient() { |
| 66 | 0 | return transientValue_; |
| 67 | |
} |
| 68 | |
|
| 69 | |
public void setTransient(boolean transientValue) { |
| 70 | 0 | transientValue_ = transientValue; |
| 71 | 0 | } |
| 72 | |
|
| 73 | |
public Object saveState(FacesContext context) { |
| 74 | 0 | return null; |
| 75 | |
} |
| 76 | |
|
| 77 | |
public void restoreState(FacesContext context, Object state) { |
| 78 | 0 | } |
| 79 | |
|
| 80 | |
public String getExpressionString() { |
| 81 | 41 | return exprStr_; |
| 82 | |
} |
| 83 | |
|
| 84 | |
public void setExpressionString(String exprStr) { |
| 85 | 49 | exprStr_ = exprStr; |
| 86 | 49 | } |
| 87 | |
} |