View Javadoc
1   package ca.uhn.hl7v2.conf.spec;
2   
3   import ca.uhn.hl7v2.conf.spec.usecase.UseCase;
4   import ca.uhn.hl7v2.conf.spec.message.StaticDef;
5   
6   import java.beans.PropertyVetoException;
7   
8   /**
9    * A conformance specification (see HL7 2.5 section 2.12).  
10   * @author Bryan Tripp
11   */
12  public class Specification {
13      
14      private ImpNote impNote;
15      private UseCase useCase;
16      private Conformance conformance;
17      private Encoding[] encodings;
18          
19      /** Utility field used by bound properties. */
20      private final java.beans.PropertyChangeSupport propertyChangeSupport =  new java.beans.PropertyChangeSupport(this);
21      
22      /** Utility field used by constrained properties. */
23      private final java.beans.VetoableChangeSupport vetoableChangeSupport =  new java.beans.VetoableChangeSupport(this);
24      
25      /** Holds value of property message. */
26      private StaticDef message;
27      
28      /** Holds value of property specName. */
29      private String specName;
30      
31      /** Holds value of property orgName. */
32      private String orgName;
33      
34      /** Holds value of property HL7Version. */
35      private String HL7Version;
36      
37      /** Holds value of property specVersion. */
38      private String specVersion;
39      
40      /** Holds value of property status. */
41      private String status;
42      
43      /** Holds value of property role. */
44      private String role;
45      
46      /** Holds value of property HL7OID. */
47      private String HL7OID;
48      
49      /** Holds value of property conformanceType. */
50      private String conformanceType;
51      
52      /** Creates a new instance of Specification */
53      public Specification() {
54      }
55      
56      /** Adds a PropertyChangeListener to the listener list.
57       * @param l The listener to add.
58       */
59      public void addPropertyChangeListener(java.beans.PropertyChangeListener l) {
60          propertyChangeSupport.addPropertyChangeListener(l);
61      }
62      
63      /** Removes a PropertyChangeListener from the listener list.
64       * @param l The listener to remove.
65       */
66      public void removePropertyChangeListener(java.beans.PropertyChangeListener l) {
67          propertyChangeSupport.removePropertyChangeListener(l);
68      }
69      
70      /** Adds a VetoableChangeListener to the listener list.
71       * @param l The listener to add.
72       */
73      public void addVetoableChangeListener(java.beans.VetoableChangeListener l) {
74          vetoableChangeSupport.addVetoableChangeListener(l);
75      }
76      
77      /** Removes a VetoableChangeListener from the listener list.
78       * @param l The listener to remove.
79       */
80      public void removeVetoableChangeListener(java.beans.VetoableChangeListener l) {
81          vetoableChangeSupport.removeVetoableChangeListener(l);
82      }
83      
84      /** Getter for property impNote.
85       * @return Value of property impNote.
86       */
87      public ImpNote getImpNote() {
88          return this.impNote;
89      }
90      
91      /** Setter for property impNote.
92       * @param impNote New value of property impNote.
93       *
94       * @throws PropertyVetoException
95       */
96      public void setImpNote(ImpNote impNote) throws PropertyVetoException {
97          ImpNote oldImpNote = this.impNote;
98          vetoableChangeSupport.fireVetoableChange("impNote", oldImpNote, impNote);
99          this.impNote = impNote;
100         propertyChangeSupport.firePropertyChange("impNote", oldImpNote, impNote);
101     }
102     
103     /** Getter for property useCase.
104      * @return Value of property useCase.
105      */
106     public UseCase getUseCase() {
107         return this.useCase;
108     }
109     
110     /** Setter for property useCase.
111      * @param useCase New value of property useCase.
112      *
113      * @throws PropertyVetoException
114      */
115     public void setUseCase(UseCase useCase) throws PropertyVetoException {
116         UseCase oldUseCase = this.useCase;
117         vetoableChangeSupport.fireVetoableChange("useCase", oldUseCase, useCase);
118         this.useCase = useCase;
119         propertyChangeSupport.firePropertyChange("useCase", oldUseCase, useCase);
120     }
121     
122     /** Getter for property conformance.
123      * @return Value of property conformance.
124      */
125     public Conformance getConformance() {
126         return this.conformance;
127     }
128     
129     /** Setter for property conformance.
130      * @param conformance New value of property conformance.
131      *
132      * @throws PropertyVetoException
133      */
134     public void setConformance(Conformance conformance) throws PropertyVetoException {
135         Conformance oldConformance = this.conformance;
136         vetoableChangeSupport.fireVetoableChange("conformance", oldConformance, conformance);
137         this.conformance = conformance;
138         propertyChangeSupport.firePropertyChange("conformance", oldConformance, conformance);
139     }
140     
141     /** Indexed getter for property encodings.
142      * @param index Index of the property.
143      * @return Value of the property at <CODE>index</CODE>.
144      */
145     public Encoding getEncodings(int index) {
146         return this.encodings[index];
147     }
148     
149     /** Indexed setter for property encodings.
150      * @param index Index of the property.
151      * @param encodings New value of the property at <CODE>index</CODE>.
152      *
153      * @throws PropertyVetoException
154      */
155     public void setEncodings(int index, Encoding encodings) throws PropertyVetoException {
156         Encoding oldEncodings = this.encodings[index];
157         this.encodings[index] = encodings;
158         try {
159             vetoableChangeSupport.fireVetoableChange("encodings", null, null );
160         }
161         catch(PropertyVetoException vetoException ) {
162             this.encodings[index] = oldEncodings;
163             throw vetoException;
164         }
165         propertyChangeSupport.firePropertyChange("encodings", null, null );
166     }
167     
168     /** Getter for property message.
169      * @return Value of property message.
170      */
171     public StaticDef getMessage() {
172         return this.message;
173     }
174     
175     /** Setter for property message.
176      * @param message New value of property message.
177      *
178      * @throws PropertyVetoException
179      */
180     public void setMessage(StaticDef message) throws PropertyVetoException {
181         StaticDef oldMessage = this.message;
182         vetoableChangeSupport.fireVetoableChange("message", oldMessage, message);
183         this.message = message;
184         propertyChangeSupport.firePropertyChange("message", oldMessage, message);
185     }
186     
187     /** Getter for property specName.
188      * @return Value of property specName.
189      */
190     public String getSpecName() {
191         return this.specName;
192     }
193     
194     /** Setter for property specName.
195      * @param specName New value of property specName.
196      *
197      * @throws PropertyVetoException
198      */
199     public void setSpecName(String specName) throws PropertyVetoException {
200         String oldSpecName = this.specName;
201         vetoableChangeSupport.fireVetoableChange("specName", oldSpecName, specName);
202         this.specName = specName;
203         propertyChangeSupport.firePropertyChange("specName", oldSpecName, specName);
204     }
205     
206     /** Getter for property orgName.
207      * @return Value of property orgName.
208      */
209     public String getOrgName() {
210         return this.orgName;
211     }
212     
213     /** Setter for property orgName.
214      * @param orgName New value of property orgName.
215      *
216      * @throws PropertyVetoException
217      */
218     public void setOrgName(String orgName) throws PropertyVetoException {
219         String oldOrgName = this.orgName;
220         vetoableChangeSupport.fireVetoableChange("orgName", oldOrgName, orgName);
221         this.orgName = orgName;
222         propertyChangeSupport.firePropertyChange("orgName", oldOrgName, orgName);
223     }
224     
225     /** Getter for property HL7Version.
226      * @return Value of property HL7Version.
227      */
228     public String getHL7Version() {
229         return this.HL7Version;
230     }
231     
232     /** Setter for property HL7Version.
233      * @param HL7Version New value of property HL7Version.
234      *
235      * @throws PropertyVetoException
236      */
237     public void setHL7Version(String HL7Version) throws PropertyVetoException {
238         String oldHL7Version = this.HL7Version;
239         vetoableChangeSupport.fireVetoableChange("HL7Version", oldHL7Version, HL7Version);
240         this.HL7Version = HL7Version;
241         propertyChangeSupport.firePropertyChange("HL7Version", oldHL7Version, HL7Version);
242     }
243     
244     /** Getter for property specVersion.
245      * @return Value of property specVersion.
246      */
247     public String getSpecVersion() {
248         return this.specVersion;
249     }
250     
251     /** Setter for property specVersion.
252      * @param specVersion New value of property specVersion.
253      *
254      * @throws PropertyVetoException
255      */
256     public void setSpecVersion(String specVersion) throws PropertyVetoException {
257         String oldSpecVersion = this.specVersion;
258         vetoableChangeSupport.fireVetoableChange("specVersion", oldSpecVersion, specVersion);
259         this.specVersion = specVersion;
260         propertyChangeSupport.firePropertyChange("specVersion", oldSpecVersion, specVersion);
261     }
262     
263     /** Getter for property status.
264      * @return Value of property status.
265      */
266     public String getStatus() {
267         return this.status;
268     }
269     
270     /** Setter for property status.
271      * @param status New value of property status.
272      *
273      * @throws PropertyVetoException
274      */
275     public void setStatus(String status) throws PropertyVetoException {
276         String oldStatus = this.status;
277         vetoableChangeSupport.fireVetoableChange("status", oldStatus, status);
278         this.status = status;
279         propertyChangeSupport.firePropertyChange("status", oldStatus, status);
280     }
281     
282     /** Getter for property role.
283      * @return Value of property role.
284      */
285     public String getRole() {
286         return this.role;
287     }
288     
289     /** Setter for property role.
290      * @param role New value of property role.
291      *
292      * @throws PropertyVetoException
293      */
294     public void setRole(String role) throws PropertyVetoException {
295         String oldRole = this.role;
296         vetoableChangeSupport.fireVetoableChange("role", oldRole, role);
297         this.role = role;
298         propertyChangeSupport.firePropertyChange("role", oldRole, role);
299     }
300     
301     /** Getter for property HL7OID.
302      * @return Value of property HL7OID.
303      */
304     public String getHL7OID() {
305         return this.HL7OID;
306     }
307     
308     /** Setter for property HL7OID.
309      * @param HL7OID New value of property HL7OID.
310      *
311      * @throws PropertyVetoException
312      */
313     public void setHL7OID(String HL7OID) throws PropertyVetoException {
314         String oldHL7OID = this.HL7OID;
315         vetoableChangeSupport.fireVetoableChange("HL7OID", oldHL7OID, HL7OID);
316         this.HL7OID = HL7OID;
317         propertyChangeSupport.firePropertyChange("HL7OID", oldHL7OID, HL7OID);
318     }
319     
320     /** Getter for property conformanceType.
321      * @return Value of property conformanceType.
322      */
323     public String getConformanceType() {
324         return this.conformanceType;
325     }
326     
327     /** Setter for property conformanceType.
328      * @param conformanceType New value of property conformanceType.
329      *
330      * @throws PropertyVetoException
331      */
332     public void setConformanceType(String conformanceType) throws PropertyVetoException {
333         String oldConformanceType = this.conformanceType;
334         vetoableChangeSupport.fireVetoableChange("conformanceType", oldConformanceType, conformanceType);
335         this.conformanceType = conformanceType;
336         propertyChangeSupport.firePropertyChange("conformanceType", oldConformanceType, conformanceType);
337     }
338     
339 }