Coverage Report - javax.faces.component.UISelectItems
 
Classes in this File Line Coverage Branch Coverage Complexity
UISelectItems
100%
17/17
100%
2/2
1.333
 
 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 javax.faces.component;
 17  
 
 18  
 import javax.faces.context.FacesContext;
 19  
 
 20  
 /**
 21  
  * @author shot
 22  
  */
 23  
 public class UISelectItems extends UIComponentBase {
 24  
 
 25  
     public static final String COMPONENT_FAMILY = "javax.faces.SelectItems";
 26  
 
 27  
     public static final String COMPONENT_TYPE = "javax.faces.SelectItems";
 28  
 
 29  92
     private Object value = null;
 30  
 
 31  
     private static final String VALUE_BINDING_NAME = "value";
 32  
 
 33  92
     public UISelectItems() {
 34  92
     }
 35  
 
 36  
     public String getFamily() {
 37  5
         return COMPONENT_FAMILY;
 38  
     }
 39  
 
 40  
     public Object getValue() {
 41  18
         if (value != null) {
 42  16
             return value;
 43  
         }
 44  2
         return ComponentUtil_.getValueBindingValue(this, VALUE_BINDING_NAME);
 45  
     }
 46  
 
 47  
     public void setValue(Object value) {
 48  13
         this.value = value;
 49  13
     }
 50  
 
 51  
     public void restoreState(FacesContext context, Object state) {
 52  2
         Object values[] = (Object[]) state;
 53  2
         super.restoreState(context, values[0]);
 54  2
         value = values[1];
 55  2
     }
 56  
 
 57  
     public Object saveState(FacesContext context) {
 58  3
         Object values[] = new Object[2];
 59  3
         values[0] = super.saveState(context);
 60  3
         values[1] = value;
 61  3
         return values;
 62  
     }
 63  
 
 64  
 }