001package ca.uhn.hl7v2.conf.spec;
002
003import ca.uhn.hl7v2.conf.ProfileException;
004
005/**
006 * Conformance Profile meta data (an element of ConformanceProfile and StaticDef).  
007 * @author Bryan Tripp
008 */
009public class MetaData {
010    
011    /** Holds value of property name. */
012    private String name;
013    
014    /** Utility field used by bound properties. */
015    private java.beans.PropertyChangeSupport propertyChangeSupport =  new java.beans.PropertyChangeSupport(this);
016    
017    /** Utility field used by constrained properties. */
018    private java.beans.VetoableChangeSupport vetoableChangeSupport =  new java.beans.VetoableChangeSupport(this);
019    
020    /** Holds value of property orgName. */
021    private String orgName;
022    
023    /** Holds value of property version. */
024    private String version;
025    
026    /** Holds value of property status. */
027    private String status;
028    
029    /** Holds value of property topics. */
030    private String topics;
031    
032    /** Creates a new instance of MetaData */
033    public MetaData() {
034    }
035    
036    /** Adds a PropertyChangeListener to the listener list.
037     * @param l The listener to add.
038     */
039    public void addPropertyChangeListener(java.beans.PropertyChangeListener l) {
040        propertyChangeSupport.addPropertyChangeListener(l);
041    }    
042    
043    /** Removes a PropertyChangeListener from the listener list.
044     * @param l The listener to remove.
045     */
046    public void removePropertyChangeListener(java.beans.PropertyChangeListener l) {
047        propertyChangeSupport.removePropertyChangeListener(l);
048    }    
049    
050    /** Adds a VetoableChangeListener to the listener list.
051     * @param l The listener to add.
052     */
053    public void addVetoableChangeListener(java.beans.VetoableChangeListener l) {
054        vetoableChangeSupport.addVetoableChangeListener(l);
055    }
056    
057    /** Removes a VetoableChangeListener from the listener list.
058     * @param l The listener to remove.
059     */
060    public void removeVetoableChangeListener(java.beans.VetoableChangeListener l) {
061        vetoableChangeSupport.removeVetoableChangeListener(l);
062    }
063    
064    /** Getter for property name.
065     * @return Value of property name.
066     */
067    public String getName() {
068        return this.name;
069    }
070    
071    /** Setter for property name.
072     * @param name New value of property name.
073     *
074     * @throws ProfileException
075     */
076    public void setName(String name) throws ProfileException {
077        String oldName = this.name;
078        try {
079            vetoableChangeSupport.fireVetoableChange("name", oldName, name);
080        } catch (Exception e) {
081            throw new ProfileException(null, e);
082        }
083        this.name = name;
084        propertyChangeSupport.firePropertyChange("name", oldName, name);
085    }
086    
087    /** Getter for property orgName.
088     * @return Value of property orgName.
089     */
090    public String getOrgName() {
091        return this.orgName;
092    }
093    
094    /** Setter for property orgName.
095     * @param orgName New value of property orgName.
096     *
097     * @throws ProfileException
098     */
099    public void setOrgName(String orgName) throws ProfileException {
100        String oldOrgName = this.orgName;
101        try {
102            vetoableChangeSupport.fireVetoableChange("orgName", oldOrgName, orgName);
103        } catch (Exception e) {
104            throw new ProfileException(null, e);
105        }
106        this.orgName = orgName;
107        propertyChangeSupport.firePropertyChange("orgName", oldOrgName, orgName);
108    }
109    
110    /** Getter for property version.
111     * @return Value of property version.
112     */
113    public String getVersion() {
114        return this.version;
115    }
116    
117    /** Setter for property version.
118     * @param version New value of property version.
119     *
120     * @throws ProfileException
121     */
122    public void setVersion(String version) throws ProfileException {
123        String oldVersion = this.version;
124        try {
125            vetoableChangeSupport.fireVetoableChange("version", oldVersion, version);
126        } catch (Exception e) {
127            throw new ProfileException(null, e);
128        }
129        this.version = version;
130        propertyChangeSupport.firePropertyChange("version", oldVersion, version);
131    }
132    
133    /** Getter for property status.
134     * @return Value of property status.
135     */
136    public String getStatus() {
137        return this.status;
138    }
139    
140    /** Setter for property status.
141     * @param status New value of property status.
142     *
143     * @throws ProfileException
144     */
145    public void setStatus(String status) throws ProfileException {
146        String oldStatus = this.status;
147        try {
148            vetoableChangeSupport.fireVetoableChange("status", oldStatus, status);
149        } catch (Exception e) {
150            throw new ProfileException(null, e);
151        }
152        this.status = status;
153        propertyChangeSupport.firePropertyChange("status", oldStatus, status);
154    }
155    
156    /** Getter for property topics.
157     * @return Value of property topics.
158     */
159    public String getTopics() {
160        return this.topics;
161    }
162    
163    /** Setter for property topics.
164     * @param topics New value of property topics.
165     *
166     * @throws ProfileException
167     */
168    public void setTopics(String topics) throws ProfileException {
169        String oldTopics = this.topics;
170        try {
171            vetoableChangeSupport.fireVetoableChange("topics", oldTopics, topics);
172        } catch (Exception e) {
173            throw new ProfileException(null, e);
174        }
175        this.topics = topics;
176        propertyChangeSupport.firePropertyChange("topics", oldTopics, topics);
177    }
178    
179}