1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package javax.faces.model;
20
21 import java.io.Serializable;
22
23
24
25
26
27
28
29 public class SelectItem implements Serializable
30 {
31 private static final long serialVersionUID = 8841094741464512226L;
32
33 private Object _value;
34 private String _label;
35 private String _description;
36 private boolean _disabled;
37
38
39 public SelectItem()
40 {
41 }
42
43 public SelectItem(Object value)
44 {
45 if (value == null) throw new NullPointerException("value");
46 _value = value;
47 _label = value.toString();
48 _description = null;
49 _disabled = false;
50 }
51
52 public SelectItem(Object value, String label)
53 {
54 if (value == null) throw new NullPointerException("value");
55 if (label == null) throw new NullPointerException("label");
56 _value = value;
57 _label = label;
58 _description = null;
59 _disabled = false;
60 }
61
62 public SelectItem(Object value, String label, String description)
63 {
64 if (value == null) throw new NullPointerException("value");
65 if (label == null) throw new NullPointerException("label");
66 _value = value;
67 _label = label;
68 _description = description;
69 _disabled = false;
70 }
71
72 public SelectItem(Object value, String label, String description, boolean disabled)
73 {
74 if (value == null) throw new NullPointerException("value");
75 if (label == null) throw new NullPointerException("label");
76 _value = value;
77 _label = label;
78 _description = description;
79 _disabled = disabled;
80 }
81
82
83 public String getDescription()
84 {
85 return _description;
86 }
87
88 public void setDescription(String description)
89 {
90 _description = description;
91 }
92
93 public boolean isDisabled()
94 {
95 return _disabled;
96 }
97
98 public void setDisabled(boolean disabled)
99 {
100 _disabled = disabled;
101 }
102
103 public String getLabel()
104 {
105 return _label;
106 }
107
108 public void setLabel(String label)
109 {
110 if (label == null) throw new NullPointerException("label");
111 _label = label;
112 }
113
114 public Object getValue()
115 {
116 return _value;
117 }
118
119 public void setValue(Object value)
120 {
121 if (value == null) throw new NullPointerException("value");
122 _value = value;
123 }
124 }