Coverage Report - javax.faces.component.UIOutput
 
Classes in this File Line Coverage Branch Coverage Complexity
UIOutput
100%
27/27
100%
4/4
1.444
 
 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  
 import javax.faces.convert.Converter;
 20  
 
 21  
 /**
 22  
  * @author shot
 23  
  */
 24  
 public class UIOutput extends UIComponentBase implements ValueHolder {
 25  
 
 26  
     public static final String COMPONENT_TYPE = "javax.faces.Output";
 27  
 
 28  
     public static final String COMPONENT_FAMILY = "javax.faces.Output";
 29  
 
 30  3458
     private Converter converter = null;
 31  
 
 32  3458
     private Object value = null;
 33  
 
 34  
     private static final String DEFAULT_RENDER_TYPE = "javax.faces.Text";
 35  
 
 36  3458
     public UIOutput() {
 37  3458
         setRendererType(DEFAULT_RENDER_TYPE);
 38  3458
     }
 39  
 
 40  
     public String getFamily() {
 41  60
         return COMPONENT_FAMILY;
 42  
     }
 43  
 
 44  
     public Converter getConverter() {
 45  359
         if (converter != null) {
 46  65
             return converter;
 47  
         }
 48  294
         return (Converter) ComponentUtil_.getValueBindingValue(this,
 49  
                 "converter");
 50  
     }
 51  
 
 52  
     public void setConverter(Converter converter) {
 53  70
         this.converter = converter;
 54  70
     }
 55  
 
 56  
     public Object getLocalValue() {
 57  220
         return value;
 58  
     }
 59  
 
 60  
     public Object getValue() {
 61  380
         if (value != null) {
 62  168
             return value;
 63  
         }
 64  212
         return ComponentUtil_.getValueBindingValue(this, "value");
 65  
     }
 66  
 
 67  
     public void setValue(Object value) {
 68  362
         this.value = value;
 69  362
     }
 70  
 
 71  
     public void restoreState(FacesContext context, Object state) {
 72  77
         Object[] values = (Object[]) state;
 73  77
         super.restoreState(context, values[0]);
 74  77
         converter = (Converter) restoreAttachedState(context, values[1]);
 75  77
         value = values[2];
 76  77
     }
 77  
 
 78  
     public Object saveState(FacesContext context) {
 79  97
         Object[] values = new Object[4];
 80  97
         values[0] = super.saveState(context);
 81  97
         values[1] = saveAttachedState(context, converter);
 82  97
         values[2] = value;
 83  97
         return values;
 84  
     }
 85  
 }