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 public class SelectItem implements Serializable
27 {
28 private static final long serialVersionUID = 8841094741464512226L;
29
30 private Object _value;
31 private String _label;
32 private String _description;
33 private boolean _disabled;
34 private boolean _escape;
35 private boolean _noSelectionOption;
36
37
38 public SelectItem()
39 {
40 this(null);
41 }
42
43 public SelectItem(Object value)
44 {
45 this(value, value == null ? null : value.toString());
46 }
47
48 public SelectItem(Object value, String label)
49 {
50 this(value, label, null);
51 }
52
53 public SelectItem(Object value, String label, String description)
54 {
55 this(value, label, description, false);
56 }
57
58 public SelectItem(Object value, String label, String description, boolean disabled)
59 {
60 this(value, label, description, disabled, true);
61 }
62
63 public SelectItem(Object value, String label, String description, boolean disabled, boolean escape)
64 {
65 this(value, label, description, disabled, escape, false);
66 }
67
68
69
70
71
72
73
74
75
76
77
78
79 public SelectItem(Object value, String label, String description, boolean disabled, boolean escape,
80 boolean noSelectionOption)
81 {
82 _value = value;
83 _label = label;
84 _description = description;
85 _disabled = disabled;
86 _escape = escape;
87 _noSelectionOption = noSelectionOption;
88 }
89
90
91 public String getDescription()
92 {
93 return _description;
94 }
95
96 public String getLabel()
97 {
98 return _label;
99 }
100
101 public Object getValue()
102 {
103 return _value;
104 }
105
106 public boolean isDisabled()
107 {
108 return _disabled;
109 }
110
111 public boolean isEscape()
112 {
113 return _escape;
114 }
115
116
117
118
119
120
121
122 public boolean isNoSelectionOption()
123 {
124 return _noSelectionOption;
125 }
126
127 public void setDescription(String description)
128 {
129 _description = description;
130 }
131
132 public void setDisabled(boolean disabled)
133 {
134 _disabled = disabled;
135 }
136
137 public void setEscape(boolean escape)
138 {
139 _escape = escape;
140 }
141
142 public void setLabel(String label)
143 {
144 if (label == null)
145 {
146 throw new NullPointerException("label");
147 }
148 _label = label;
149 }
150
151
152
153
154
155
156
157 public void setNoSelectionOption(boolean noSelectionOption)
158 {
159 _noSelectionOption = noSelectionOption;
160 }
161
162 public void setValue(Object value)
163 {
164 _value = value;
165 }
166
167 }