Coverage Report - javax.faces.model.SelectItem
 
Classes in this File Line Coverage Branch Coverage Complexity
SelectItem
0%
0/54
0%
0/4
1.125
 
 1  
 /*
 2  
  * Licensed to the Apache Software Foundation (ASF) under one
 3  
  * or more contributor license agreements.  See the NOTICE file
 4  
  * distributed with this work for additional information
 5  
  * regarding copyright ownership.  The ASF licenses this file
 6  
  * to you under the Apache License, Version 2.0 (the
 7  
  * "License"); you may not use this file except in compliance
 8  
  * with the License.  You may obtain a copy of the License at
 9  
  *
 10  
  *   http://www.apache.org/licenses/LICENSE-2.0
 11  
  *
 12  
  * Unless required by applicable law or agreed to in writing,
 13  
  * software distributed under the License is distributed on an
 14  
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 15  
  * KIND, either express or implied.  See the License for the
 16  
  * specific language governing permissions and limitations
 17  
  * under the License.
 18  
  */
 19  
 package javax.faces.model;
 20  
 
 21  
 import java.io.Serializable;
 22  
 
 23  
 /**
 24  
  * see Javadoc of <a href="http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/index.html">JSF Specification</a>
 25  
  *
 26  
  * @author Thomas Spiegl (latest modification by $Author: lu4242 $)
 27  
  * @version $Revision: 684928 $ $Date: 2008-08-11 16:00:54 -0500 (Mon, 11 Aug 2008) $
 28  
  */
 29  
 public class SelectItem implements Serializable
 30  
 {
 31  
     private static final long serialVersionUID = 8841094741464512226L;
 32  
     // FIELDS
 33  
     private Object _value;
 34  
     private String _label;
 35  
     private String _description;
 36  
     private boolean _disabled;
 37  
     private boolean _escape;
 38  
 
 39  
     // CONSTRUCTORS
 40  
     public SelectItem()
 41  0
     {
 42  0
     }
 43  
 
 44  
     public SelectItem(Object value)
 45  0
     {
 46  0
         _value = value;
 47  0
         _label = value == null ? null : value.toString();
 48  0
         _description = null;
 49  0
         _disabled = false;
 50  0
         _escape=true;
 51  0
     }
 52  
 
 53  
     public SelectItem(Object value, String label)
 54  0
     {
 55  0
         _value = value;
 56  0
         _label = label;
 57  0
         _description = null;
 58  0
         _disabled = false;
 59  0
         _escape = true;
 60  0
     }
 61  
 
 62  
     public SelectItem(Object value, String label, String description)
 63  0
     {
 64  0
         _value = value;
 65  0
         _label = label;
 66  0
         _description = description;
 67  0
         _disabled = false;
 68  0
         _escape = true;
 69  0
     }
 70  
 
 71  
     public SelectItem(Object value, String label, String description, boolean disabled)
 72  0
     {
 73  0
         _value = value;
 74  0
         _label = label;
 75  0
         _description = description;
 76  0
         _disabled = disabled;
 77  0
         _escape = true;
 78  0
     }
 79  
 
 80  
     public SelectItem(Object value, String label, String description, boolean disabled, boolean escape)
 81  0
     {
 82  0
         _value = value;
 83  0
         _label = label;
 84  0
         _description = description;
 85  0
         _disabled = disabled;
 86  0
         this._escape = escape;
 87  0
     }
 88  
     
 89  
     // METHODS
 90  
     public String getDescription()
 91  
     {
 92  0
         return _description;
 93  
     }
 94  
 
 95  
     public void setDescription(String description)
 96  
     {
 97  0
         _description = description;
 98  0
     }
 99  
 
 100  
     public boolean isDisabled()
 101  
     {
 102  0
         return _disabled;
 103  
     }
 104  
 
 105  
     public void setDisabled(boolean disabled)
 106  
     {
 107  0
         _disabled = disabled;
 108  0
     }
 109  
 
 110  
     public String getLabel()
 111  
     {
 112  0
         return _label;
 113  
     }
 114  
 
 115  
     public void setLabel(String label)
 116  
     {
 117  0
         if (label == null)
 118  0
           throw new NullPointerException("label");
 119  0
         _label = label;
 120  0
     }
 121  
 
 122  
     public Object getValue()
 123  
     {
 124  0
         return _value;
 125  
     }
 126  
 
 127  
     public void setValue(Object value)
 128  
     {
 129  0
         _value = value;
 130  0
     }
 131  
 
 132  
     public boolean isEscape()
 133  
     {
 134  0
         return _escape;
 135  
     }
 136  
 
 137  
     public void setEscape(boolean escape)
 138  
     {
 139  0
         this._escape = escape;
 140  0
     }
 141  
     
 142  
 }