001package ca.uhn.hl7v2.conf.spec;
002
003import ca.uhn.hl7v2.conf.spec.usecase.UseCase;
004import ca.uhn.hl7v2.conf.spec.message.StaticDef;
005
006import java.beans.PropertyVetoException;
007
008/**
009 * A conformance specification (see HL7 2.5 section 2.12).  
010 * @author Bryan Tripp
011 */
012public class Specification {
013    
014    private ImpNote impNote;
015    private UseCase useCase;
016    private Conformance conformance;
017    private Encoding[] encodings;
018        
019    /** Utility field used by bound properties. */
020    private final java.beans.PropertyChangeSupport propertyChangeSupport =  new java.beans.PropertyChangeSupport(this);
021    
022    /** Utility field used by constrained properties. */
023    private final java.beans.VetoableChangeSupport vetoableChangeSupport =  new java.beans.VetoableChangeSupport(this);
024    
025    /** Holds value of property message. */
026    private StaticDef message;
027    
028    /** Holds value of property specName. */
029    private String specName;
030    
031    /** Holds value of property orgName. */
032    private String orgName;
033    
034    /** Holds value of property HL7Version. */
035    private String HL7Version;
036    
037    /** Holds value of property specVersion. */
038    private String specVersion;
039    
040    /** Holds value of property status. */
041    private String status;
042    
043    /** Holds value of property role. */
044    private String role;
045    
046    /** Holds value of property HL7OID. */
047    private String HL7OID;
048    
049    /** Holds value of property conformanceType. */
050    private String conformanceType;
051    
052    /** Creates a new instance of Specification */
053    public Specification() {
054    }
055    
056    /** Adds a PropertyChangeListener to the listener list.
057     * @param l The listener to add.
058     */
059    public void addPropertyChangeListener(java.beans.PropertyChangeListener l) {
060        propertyChangeSupport.addPropertyChangeListener(l);
061    }
062    
063    /** Removes a PropertyChangeListener from the listener list.
064     * @param l The listener to remove.
065     */
066    public void removePropertyChangeListener(java.beans.PropertyChangeListener l) {
067        propertyChangeSupport.removePropertyChangeListener(l);
068    }
069    
070    /** Adds a VetoableChangeListener to the listener list.
071     * @param l The listener to add.
072     */
073    public void addVetoableChangeListener(java.beans.VetoableChangeListener l) {
074        vetoableChangeSupport.addVetoableChangeListener(l);
075    }
076    
077    /** Removes a VetoableChangeListener from the listener list.
078     * @param l The listener to remove.
079     */
080    public void removeVetoableChangeListener(java.beans.VetoableChangeListener l) {
081        vetoableChangeSupport.removeVetoableChangeListener(l);
082    }
083    
084    /** Getter for property impNote.
085     * @return Value of property impNote.
086     */
087    public ImpNote getImpNote() {
088        return this.impNote;
089    }
090    
091    /** Setter for property impNote.
092     * @param impNote New value of property impNote.
093     *
094     * @throws PropertyVetoException
095     */
096    public void setImpNote(ImpNote impNote) throws PropertyVetoException {
097        ImpNote oldImpNote = this.impNote;
098        vetoableChangeSupport.fireVetoableChange("impNote", oldImpNote, impNote);
099        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}