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