Coverage Report - javax.faces.component.UIParameter
 
Classes in this File Line Coverage Branch Coverage Complexity
UIParameter
100%
25/25
100%
4/4
1.5
 
 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 UIParameter extends UIComponentBase {
 24  
 
 25  
     public static final String COMPONENT_TYPE = "javax.faces.Parameter";
 26  
 
 27  
     public static final String COMPONENT_FAMILY = "javax.faces.Parameter";
 28  
 
 29  149
     private String name = null;
 30  
 
 31  149
     private Object value = null;
 32  
 
 33  
     private static final String NAME_BINDING_NAME = "name";
 34  
 
 35  
     private static final String VALUE_BINDING_NAME = "value";
 36  
 
 37  
     public UIParameter() {
 38  149
         super();
 39  149
     }
 40  
 
 41  
     public String getFamily() {
 42  5
         return COMPONENT_FAMILY;
 43  
     }
 44  
 
 45  
     public String getName() {
 46  25
         if (name != null) {
 47  23
             return name;
 48  
         }
 49  2
         return (String) ComponentUtil_.getValueBindingValue(this,
 50  
                 NAME_BINDING_NAME);
 51  
     }
 52  
 
 53  
     public void setName(String name) {
 54  23
         this.name = name;
 55  23
     }
 56  
 
 57  
     public Object getValue() {
 58  27
         if (value != null) {
 59  24
             return value;
 60  
         }
 61  3
         return ComponentUtil_.getValueBindingValue(this, VALUE_BINDING_NAME);
 62  
     }
 63  
 
 64  
     public void setValue(Object value) {
 65  24
         this.value = value;
 66  24
     }
 67  
 
 68  
     public void restoreState(FacesContext context, Object state) {
 69  3
         Object[] values = (Object[]) state;
 70  3
         super.restoreState(context, values[0]);
 71  3
         name = (String) values[1];
 72  3
         value = values[2];
 73  3
     }
 74  
 
 75  
     public Object saveState(FacesContext context) {
 76  4
         Object[] values = new Object[3];
 77  4
         values[0] = super.saveState(context);
 78  4
         values[1] = name;
 79  4
         values[2] = value;
 80  4
         return values;
 81  
     }
 82  
 }