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