View Javadoc

1   package ca.uhn.hl7v2.conf.spec.message;
2   
3   import ca.uhn.hl7v2.conf.ProfileException;
4   
5   /**
6    * An explicit data value specified in a message profile.  
7    * @author Bryan Tripp
8    */
9   public class DataValue {
10      
11      /** Holds value of property exValue. */
12      private String exValue;
13      
14      /** Utility field used by bound properties. */
15      private java.beans.PropertyChangeSupport propertyChangeSupport =  new java.beans.PropertyChangeSupport(this);
16      
17      /** Utility field used by constrained properties. */
18      private java.beans.VetoableChangeSupport vetoableChangeSupport =  new java.beans.VetoableChangeSupport(this);
19      
20      /** Creates a new instance of DataValue */
21      public DataValue() {
22      }
23      
24      /** Adds a PropertyChangeListener to the listener list.
25       * @param l The listener to add.
26       */
27      public void addPropertyChangeListener(java.beans.PropertyChangeListener l) {
28          propertyChangeSupport.addPropertyChangeListener(l);
29      }
30      
31      /** Removes a PropertyChangeListener from the listener list.
32       * @param l The listener to remove.
33       */
34      public void removePropertyChangeListener(java.beans.PropertyChangeListener l) {
35          propertyChangeSupport.removePropertyChangeListener(l);
36      }
37      
38      /** Adds a VetoableChangeListener to the listener list.
39       * @param l The listener to add.
40       */
41      public void addVetoableChangeListener(java.beans.VetoableChangeListener l) {
42          vetoableChangeSupport.addVetoableChangeListener(l);
43      }
44      
45      /** Removes a VetoableChangeListener from the listener list.
46       * @param l The listener to remove.
47       */
48      public void removeVetoableChangeListener(java.beans.VetoableChangeListener l) {
49          vetoableChangeSupport.removeVetoableChangeListener(l);
50      }
51      
52      /** Getter for property exValue.
53       * @return Value of property exValue.
54       */
55      public String getExValue() {
56          return this.exValue;
57      }
58      
59      /** Setter for property exValue.
60       * @param exValue New value of property exValue.
61       *
62       * @throws ProfileException
63       */
64      public void setExValue(String exValue) throws ProfileException {
65          String oldExValue = this.exValue;
66          try {
67              vetoableChangeSupport.fireVetoableChange("exValue", oldExValue, exValue);
68          } catch (Exception e) {
69              throw new ProfileException(null, e);
70          }
71          this.exValue = exValue;
72          propertyChangeSupport.firePropertyChange("exValue", oldExValue, exValue);
73      }
74      
75  }