Coverage Report - org.seasar.teeda.core.mock.MockValueBinding
 
Classes in this File Line Coverage Branch Coverage Complexity
MockValueBinding
74%
17/23
100%
2/2
1
 
 1  
 /*
 2  
  * Copyright 2004-2011 the Seasar Foundation and the Others.
 3  
  *
 4  
  * Licensed under the Apache License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  *     http://www.apache.org/licenses/LICENSE-2.0
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 13  
  * either express or implied. See the License for the specific language
 14  
  * governing permissions and limitations under the License.
 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  
 }