1 16 package javax.faces.model; 17 18 import java.io.Serializable ; 19 20 31 public class SelectItem implements Serializable 32 { 33 private Object _value; 35 private String _label; 36 private String _description; 37 private boolean _disabled; 38 39 public SelectItem() 41 { 42 } 43 44 public SelectItem(Object value) 45 { 46 if (value == null) throw new NullPointerException ("value"); 47 _value = value; 48 _label = value.toString(); 49 _description = null; 50 _disabled = false; 51 } 52 53 public SelectItem(Object value, String label) 54 { 55 if (value == null) throw new NullPointerException ("value"); 56 if (label == null) throw new NullPointerException ("label"); 57 _value = value; 58 _label = label; 59 _description = null; 60 _disabled = false; 61 } 62 63 public SelectItem(Object value, String label, String description) 64 { 65 if (value == null) throw new NullPointerException ("value"); 66 if (label == null) throw new NullPointerException ("label"); 67 _value = value; 68 _label = label; 69 _description = description; 70 _disabled = false; 71 } 72 73 public SelectItem(Object value, String label, String description, boolean disabled) 74 { 75 if (value == null) throw new NullPointerException ("value"); 76 if (label == null) throw new NullPointerException ("label"); 77 _value = value; 78 _label = label; 79 _description = description; 80 _disabled = disabled; 81 } 82 83 public String getDescription() 85 { 86 return _description; 87 } 88 89 public void setDescription(String description) 90 { 91 _description = description; 92 } 93 94 public boolean isDisabled() 95 { 96 return _disabled; 97 } 98 99 public void setDisabled(boolean disabled) 100 { 101 _disabled = disabled; 102 } 103 104 public String getLabel() 105 { 106 return _label; 107 } 108 109 public void setLabel(String label) 110 { 111 if (label == null) throw new NullPointerException ("label"); 112 _label = label; 113 } 114 115 public Object getValue() 116 { 117 return _value; 118 } 119 120 public void setValue(Object value) 121 { 122 if (value == null) throw new NullPointerException ("value"); 123 _value = value; 124 } 125 } 126 | Popular Tags |