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