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