1 | |
package ca.uhn.hl7v2.conf.spec.message; |
2 | |
|
3 | |
import ca.uhn.hl7v2.conf.ProfileException; |
4 | |
|
5 | |
import java.util.ArrayList; |
6 | |
import java.util.List; |
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
public class AbstractComponent<T> { |
13 | |
|
14 | |
|
15 | 55525 | public AbstractComponent() { |
16 | 55525 | } |
17 | |
|
18 | |
|
19 | |
|
20 | 55525 | protected java.beans.PropertyChangeSupport propertyChangeSupport = new java.beans.PropertyChangeSupport(this); |
21 | |
|
22 | |
|
23 | 55525 | protected java.beans.VetoableChangeSupport vetoableChangeSupport = new java.beans.VetoableChangeSupport(this); |
24 | |
|
25 | |
private String impNote; |
26 | |
private String description; |
27 | |
private String reference; |
28 | |
private String predicate; |
29 | 55525 | private final List<DataValue> dataValues = new ArrayList<DataValue>(); |
30 | |
private String name; |
31 | |
private String usage; |
32 | |
private String datatype; |
33 | |
private long length; |
34 | |
private String constantValue; |
35 | |
private String table; |
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
public void addPropertyChangeListener(java.beans.PropertyChangeListener l) { |
41 | 0 | propertyChangeSupport.addPropertyChangeListener(l); |
42 | 0 | } |
43 | |
|
44 | |
|
45 | |
|
46 | |
|
47 | |
public void removePropertyChangeListener(java.beans.PropertyChangeListener l) { |
48 | 0 | propertyChangeSupport.removePropertyChangeListener(l); |
49 | 0 | } |
50 | |
|
51 | |
|
52 | |
|
53 | |
|
54 | |
public void addVetoableChangeListener(java.beans.VetoableChangeListener l) { |
55 | 0 | vetoableChangeSupport.addVetoableChangeListener(l); |
56 | 0 | } |
57 | |
|
58 | |
|
59 | |
|
60 | |
|
61 | |
public void removeVetoableChangeListener(java.beans.VetoableChangeListener l) { |
62 | 0 | vetoableChangeSupport.removeVetoableChangeListener(l); |
63 | 0 | } |
64 | |
|
65 | |
|
66 | |
|
67 | |
|
68 | |
public String getImpNote() { |
69 | 0 | return this.impNote; |
70 | |
} |
71 | |
|
72 | |
|
73 | |
|
74 | |
|
75 | |
|
76 | |
|
77 | |
public void setImpNote(String impNote) throws ProfileException { |
78 | 55525 | String oldImpNote = this.impNote; |
79 | |
try { |
80 | 55525 | vetoableChangeSupport.fireVetoableChange("impNote", oldImpNote, impNote); |
81 | 0 | } catch (Exception e) { |
82 | 0 | throw new ProfileException(null, e); |
83 | 55525 | } |
84 | 55525 | this.impNote = impNote; |
85 | 55525 | propertyChangeSupport.firePropertyChange("impNote", oldImpNote, impNote); |
86 | 55525 | } |
87 | |
|
88 | |
|
89 | |
|
90 | |
|
91 | |
public String getDescription() { |
92 | 0 | return this.description; |
93 | |
} |
94 | |
|
95 | |
|
96 | |
|
97 | |
|
98 | |
|
99 | |
|
100 | |
public void setDescription(String description) throws ProfileException { |
101 | 55525 | String oldDescription = this.description; |
102 | |
try { |
103 | 55525 | vetoableChangeSupport.fireVetoableChange("description", oldDescription, description); |
104 | 0 | } catch (Exception e) { |
105 | 0 | throw new ProfileException(null, e); |
106 | 55525 | } |
107 | 55525 | this.description = description; |
108 | 55525 | propertyChangeSupport.firePropertyChange("description", oldDescription, description); |
109 | 55525 | } |
110 | |
|
111 | |
|
112 | |
|
113 | |
|
114 | |
public String getReference() { |
115 | 5 | return this.reference; |
116 | |
} |
117 | |
|
118 | |
|
119 | |
|
120 | |
|
121 | |
|
122 | |
|
123 | |
public void setReference(String reference) throws ProfileException { |
124 | 55525 | String oldReference = this.reference; |
125 | |
try { |
126 | 55525 | vetoableChangeSupport.fireVetoableChange("reference", oldReference, reference); |
127 | 0 | } catch (Exception e) { |
128 | 0 | throw new ProfileException(null, e); |
129 | 55525 | } |
130 | 55525 | this.reference = reference; |
131 | 55525 | propertyChangeSupport.firePropertyChange("reference", oldReference, reference); |
132 | 55525 | } |
133 | |
|
134 | |
|
135 | |
|
136 | |
|
137 | |
public String getPredicate() { |
138 | 0 | return this.predicate; |
139 | |
} |
140 | |
|
141 | |
|
142 | |
|
143 | |
|
144 | |
|
145 | |
|
146 | |
public void setPredicate(String predicate) throws ProfileException { |
147 | 55525 | String oldPredicate = this.predicate; |
148 | |
try { |
149 | 55525 | vetoableChangeSupport.fireVetoableChange("predicate", oldPredicate, predicate); |
150 | 0 | } catch (Exception e) { |
151 | 0 | throw new ProfileException(null, e); |
152 | 55525 | } |
153 | 55525 | this.predicate = predicate; |
154 | 55525 | propertyChangeSupport.firePropertyChange("predicate", oldPredicate, predicate); |
155 | 55525 | } |
156 | |
|
157 | |
|
158 | |
|
159 | |
|
160 | |
|
161 | |
public DataValue getDataValues(int index) { |
162 | 0 | return this.dataValues.get(index); |
163 | |
} |
164 | |
|
165 | |
|
166 | |
|
167 | |
|
168 | |
|
169 | |
|
170 | |
|
171 | |
public void setDataValues(int index, DataValue dataValue) throws ProfileException { |
172 | 5820 | while (dataValues.size() <= index) { |
173 | 2910 | dataValues.add(null); |
174 | |
} |
175 | 2910 | DataValue oldDataValues = this.dataValues.get(index); |
176 | 2910 | this.dataValues.set(index, dataValue); |
177 | |
try { |
178 | 2910 | vetoableChangeSupport.fireVetoableChange("dataValues", null, null ); |
179 | |
} |
180 | 0 | catch(java.beans.PropertyVetoException vetoException ) { |
181 | 0 | this.dataValues.set(index, oldDataValues); |
182 | 0 | throw new ProfileException(null, vetoException); |
183 | 2910 | } |
184 | 2910 | propertyChangeSupport.firePropertyChange("dataValues", null, null ); |
185 | 2910 | } |
186 | |
|
187 | |
|
188 | |
|
189 | |
|
190 | |
|
191 | |
|
192 | |
|
193 | |
public String getName() { |
194 | 8695 | return this.name; |
195 | |
} |
196 | |
|
197 | |
|
198 | |
|
199 | |
|
200 | |
|
201 | |
|
202 | |
public void setName(String name) throws ProfileException { |
203 | 55525 | String oldName = this.name; |
204 | |
try { |
205 | 55525 | vetoableChangeSupport.fireVetoableChange("name", oldName, name); |
206 | 0 | } catch (Exception e) { |
207 | 0 | throw new ProfileException(null, e); |
208 | 55525 | } |
209 | 55525 | this.name = name; |
210 | 55525 | propertyChangeSupport.firePropertyChange("name", oldName, name); |
211 | 55525 | } |
212 | |
|
213 | |
|
214 | |
|
215 | |
|
216 | |
public String getUsage() { |
217 | 12365 | return this.usage; |
218 | |
} |
219 | |
|
220 | |
|
221 | |
|
222 | |
|
223 | |
|
224 | |
|
225 | |
public void setUsage(String usage) throws ProfileException { |
226 | 62895 | String oldUsage = this.usage; |
227 | |
try { |
228 | 62895 | vetoableChangeSupport.fireVetoableChange("usage", oldUsage, usage); |
229 | 0 | } catch (Exception e) { |
230 | 0 | throw new ProfileException(null, e); |
231 | 62895 | } |
232 | 62895 | this.usage = usage; |
233 | 62895 | propertyChangeSupport.firePropertyChange("usage", oldUsage, usage); |
234 | 62895 | } |
235 | |
|
236 | |
|
237 | |
|
238 | |
|
239 | |
public String getDatatype() { |
240 | 2985 | return this.datatype; |
241 | |
} |
242 | |
|
243 | |
|
244 | |
|
245 | |
|
246 | |
|
247 | |
|
248 | |
public void setDatatype(String datatype) throws ProfileException { |
249 | 55525 | String oldDatatype = this.datatype; |
250 | |
try { |
251 | 55525 | vetoableChangeSupport.fireVetoableChange("datatype", oldDatatype, datatype); |
252 | 0 | } catch (Exception e) { |
253 | 0 | throw new ProfileException(null, e); |
254 | 55525 | } |
255 | 55525 | this.datatype = datatype; |
256 | 55525 | propertyChangeSupport.firePropertyChange("datatype", oldDatatype, datatype); |
257 | 55525 | } |
258 | |
|
259 | |
|
260 | |
|
261 | |
|
262 | |
public long getLength() { |
263 | 2985 | return this.length; |
264 | |
} |
265 | |
|
266 | |
|
267 | |
|
268 | |
|
269 | |
|
270 | |
|
271 | |
public void setLength(long length) throws ProfileException { |
272 | 55120 | long oldLength = this.length; |
273 | |
try { |
274 | 55120 | vetoableChangeSupport.fireVetoableChange("length", oldLength, length); |
275 | 0 | } catch (Exception e) { |
276 | 0 | throw new ProfileException(null, e); |
277 | 55120 | } |
278 | 55120 | this.length = length; |
279 | 55120 | propertyChangeSupport.firePropertyChange("length", new Long(oldLength), new Long(length)); |
280 | 55120 | } |
281 | |
|
282 | |
|
283 | |
|
284 | |
|
285 | |
public String getConstantValue() { |
286 | 2970 | return this.constantValue; |
287 | |
} |
288 | |
|
289 | |
|
290 | |
|
291 | |
|
292 | |
|
293 | |
|
294 | |
public void setConstantValue(String constantValue) throws ProfileException { |
295 | 55525 | String oldConstantValue = this.constantValue; |
296 | |
try { |
297 | 55525 | vetoableChangeSupport.fireVetoableChange("constantValue", oldConstantValue, constantValue); |
298 | 0 | } catch (Exception e) { |
299 | 0 | throw new ProfileException(null, e); |
300 | 55525 | } |
301 | 55525 | this.constantValue = constantValue; |
302 | 55525 | propertyChangeSupport.firePropertyChange("constantValue", oldConstantValue, constantValue); |
303 | 55525 | } |
304 | |
|
305 | |
|
306 | |
|
307 | |
|
308 | |
public String getTable() { |
309 | 4205 | return this.table; |
310 | |
} |
311 | |
|
312 | |
|
313 | |
|
314 | |
|
315 | |
|
316 | |
|
317 | |
public void setTable(String table) throws ProfileException { |
318 | 20280 | String oldTable = this.table; |
319 | |
try { |
320 | 20280 | vetoableChangeSupport.fireVetoableChange("table", oldTable, table); |
321 | 0 | } catch (Exception e) { |
322 | 0 | throw new ProfileException(null, e); |
323 | 20280 | } |
324 | 20280 | this.table = table; |
325 | 20280 | propertyChangeSupport.firePropertyChange("table", oldTable, table); |
326 | 20280 | } |
327 | |
|
328 | |
} |