001package ca.uhn.hl7v2.conf.spec.usecase;
002
003import java.beans.PropertyVetoException;
004
005/**
006 * The use case portion of a conformance specification.  
007 * @author Bryan Tripp
008 */
009public class UseCase {
010    
011    /** Holds value of property actor. */
012    private Actor actor;
013    
014    /** Utility field used by bound properties. */
015    private final java.beans.PropertyChangeSupport propertyChangeSupport =  new java.beans.PropertyChangeSupport(this);
016    
017    /** Utility field used by constrained properties. */
018    private final java.beans.VetoableChangeSupport vetoableChangeSupport =  new java.beans.VetoableChangeSupport(this);
019    
020    /** Holds value of property preCondition. */
021    private PreCondition preCondition;
022    
023    /** Holds value of property postCondition. */
024    private PostCondition postCondition;
025    
026    /** Holds value of property eventFlow. */
027    private EventFlow eventFlow;
028    
029    /** Holds value of property derivativeEvent. */
030    private DerivativeEvent derivativeEvent;
031    
032    /** Creates a new instance of UseCase */
033    public UseCase() {
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 actor.
065     * @return Value of property actor.
066     */
067    public Actor getActor() {
068        return this.actor;
069    }
070    
071    /** Setter for property actor.
072     * @param actor New value of property actor.
073     *
074     * @throws PropertyVetoException
075     */
076    public void setActor(Actor actor) throws PropertyVetoException {
077        Actor oldActor = this.actor;
078        vetoableChangeSupport.fireVetoableChange("actor", oldActor, actor);
079        this.actor = actor;
080        propertyChangeSupport.firePropertyChange("actor", oldActor, actor);
081    }
082    
083    /** Getter for property preCondition.
084     * @return Value of property preCondition.
085     */
086    public PreCondition getPreCondition() {
087        return this.preCondition;
088    }
089    
090    /** Setter for property preCondition.
091     * @param preCondition New value of property preCondition.
092     *
093     * @throws PropertyVetoException
094     */
095    public void setPreCondition(PreCondition preCondition) throws PropertyVetoException {
096        PreCondition oldPreCondition = this.preCondition;
097        vetoableChangeSupport.fireVetoableChange("preCondition", oldPreCondition, preCondition);
098        this.preCondition = preCondition;
099        propertyChangeSupport.firePropertyChange("preCondition", oldPreCondition, preCondition);
100    }
101    
102    /** Getter for property postCondition.
103     * @return Value of property postCondition.
104     */
105    public PostCondition getPostCondition() {
106        return this.postCondition;
107    }
108    
109    /** Setter for property postCondition.
110     * @param postCondition New value of property postCondition.
111     *
112     * @throws PropertyVetoException
113     */
114    public void setPostCondition(PostCondition postCondition) throws PropertyVetoException {
115        PostCondition oldPostCondition = this.postCondition;
116        vetoableChangeSupport.fireVetoableChange("postCondition", oldPostCondition, postCondition);
117        this.postCondition = postCondition;
118        propertyChangeSupport.firePropertyChange("postCondition", oldPostCondition, postCondition);
119    }
120    
121    /** Getter for property eventFlow.
122     * @return Value of property eventFlow.
123     */
124    public EventFlow getEventFlow() {
125        return this.eventFlow;
126    }
127    
128    /** Setter for property eventFlow.
129     * @param eventFlow New value of property eventFlow.
130     *
131     * @throws PropertyVetoException
132     */
133    public void setEventFlow(EventFlow eventFlow) throws PropertyVetoException {
134        EventFlow oldEventFlow = this.eventFlow;
135        vetoableChangeSupport.fireVetoableChange("eventFlow", oldEventFlow, eventFlow);
136        this.eventFlow = eventFlow;
137        propertyChangeSupport.firePropertyChange("eventFlow", oldEventFlow, eventFlow);
138    }
139    
140    /** Getter for property derivativeEvent.
141     * @return Value of property derivativeEvent.
142     */
143    public DerivativeEvent getDerivativeEvent() {
144        return this.derivativeEvent;
145    }
146    
147    /** Setter for property derivativeEvent.
148     * @param derivativeEvent New value of property derivativeEvent.
149     *
150     * @throws PropertyVetoException
151     */
152    public void setDerivativeEvent(DerivativeEvent derivativeEvent) throws PropertyVetoException {
153        DerivativeEvent oldDerivativeEvent = this.derivativeEvent;
154        vetoableChangeSupport.fireVetoableChange("derivativeEvent", oldDerivativeEvent, derivativeEvent);
155        this.derivativeEvent = derivativeEvent;
156        propertyChangeSupport.firePropertyChange("derivativeEvent", oldDerivativeEvent, derivativeEvent);
157    }
158    
159}