View Javadoc

1   package ca.uhn.hl7v2.conf.spec.usecase;
2   
3   /**
4    * An abstraction of the parts of a use case (eg EventFlow), all of which have a name and a body.  
5    * @author Bryan Tripp 
6    */
7   public class AbstractUseCaseComponent {
8       
9       /** Holds value of property name. */
10      private String name;
11      
12      /** Utility field used by bound properties. */
13      private java.beans.PropertyChangeSupport propertyChangeSupport =  new java.beans.PropertyChangeSupport(this);
14      
15      /** Utility field used by constrained properties. */
16      private java.beans.VetoableChangeSupport vetoableChangeSupport =  new java.beans.VetoableChangeSupport(this);
17      
18      /** Holds value of property body. */
19      private String body;
20      
21      /** Creates a new instance of AbstractUseCaseComponent */
22      public AbstractUseCaseComponent() {
23      }
24      
25      /** Adds a PropertyChangeListener to the listener list.
26       * @param l The listener to add.
27       */
28      public void addPropertyChangeListener(java.beans.PropertyChangeListener l) {
29          propertyChangeSupport.addPropertyChangeListener(l);
30      }
31      
32      /** Removes a PropertyChangeListener from the listener list.
33       * @param l The listener to remove.
34       */
35      public void removePropertyChangeListener(java.beans.PropertyChangeListener l) {
36          propertyChangeSupport.removePropertyChangeListener(l);
37      }
38      
39      /** Adds a VetoableChangeListener to the listener list.
40       * @param l The listener to add.
41       */
42      public void addVetoableChangeListener(java.beans.VetoableChangeListener l) {
43          vetoableChangeSupport.addVetoableChangeListener(l);
44      }
45      
46      /** Removes a VetoableChangeListener from the listener list.
47       * @param l The listener to remove.
48       */
49      public void removeVetoableChangeListener(java.beans.VetoableChangeListener l) {
50          vetoableChangeSupport.removeVetoableChangeListener(l);
51      }
52      
53      /** Getter for property name.
54       * @return Value of property name.
55       */
56      public String getName() {
57          return this.name;
58      }
59      
60      /** Setter for property name.
61       * @param name New value of property name.
62       *
63       * @throws PropertyVetoException
64       */
65      public void setName(String name) throws java.beans.PropertyVetoException {
66          String oldName = this.name;
67          vetoableChangeSupport.fireVetoableChange("name", oldName, name);
68          this.name = name;
69          propertyChangeSupport.firePropertyChange("name", oldName, name);
70      }
71      
72      /** Getter for property body.
73       * @return Value of property body.
74       */
75      public String getBody() {
76          return this.body;
77      }
78      
79      /** Setter for property body.
80       * @param body New value of property body.
81       *
82       * @throws PropertyVetoException
83       */
84      public void setBody(String body) throws java.beans.PropertyVetoException {
85          String oldBody = this.body;
86          vetoableChangeSupport.fireVetoableChange("body", oldBody, body);
87          this.body = body;
88          propertyChangeSupport.firePropertyChange("body", oldBody, body);
89      }
90      
91  }