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