Coverage Report - ca.uhn.hl7v2.conf.spec.message.SegGroup
 
Classes in this File Line Coverage Branch Coverage Complexity
SegGroup
62%
42/67
N/A
1.667
 
 1  
 package ca.uhn.hl7v2.conf.spec.message;
 2  
 
 3  
 import ca.uhn.hl7v2.conf.ProfileException;
 4  
 
 5  
 /**
 6  
  * A specification for a segment group in a conformance profile.  
 7  
  * @author Bryan Tripp
 8  
  */
 9  
 public class SegGroup extends AbstractSegmentContainer implements ProfileStructure {
 10  
     
 11  
     private String predicate;
 12  
     private String name;
 13  
     private String longName;
 14  
     private String usage;
 15  
     private short min;
 16  
     private short max;
 17  
     
 18  
     /** Utility field used by bound properties. */
 19  18
     private java.beans.PropertyChangeSupport propertyChangeSupport =  new java.beans.PropertyChangeSupport(this);
 20  
     
 21  
     /** Utility field used by constrained properties. */
 22  18
     private java.beans.VetoableChangeSupport vetoableChangeSupport =  new java.beans.VetoableChangeSupport(this);
 23  
     
 24  
     /** Creates a new instance of SegGroup */
 25  18
     public SegGroup() {
 26  18
     }
 27  
     
 28  
     /**
 29  
          * {@inheritDoc}
 30  
          */
 31  
         @Override
 32  
         public String toString() {
 33  0
                 return "SegGroup[" + getName() + "]";
 34  
         }
 35  
 
 36  
         /** Adds a PropertyChangeListener to the listener list.
 37  
      * @param l The listener to add.
 38  
      */
 39  
     public void addPropertyChangeListener(java.beans.PropertyChangeListener l) {
 40  0
         propertyChangeSupport.addPropertyChangeListener(l);
 41  0
     }
 42  
     
 43  
     /** Removes a PropertyChangeListener from the listener list.
 44  
      * @param l The listener to remove.
 45  
      */
 46  
     public void removePropertyChangeListener(java.beans.PropertyChangeListener l) {
 47  0
         propertyChangeSupport.removePropertyChangeListener(l);
 48  0
     }
 49  
     
 50  
     /** Adds a VetoableChangeListener to the listener list.
 51  
      * @param l The listener to add.
 52  
      */
 53  
     public void addVetoableChangeListener(java.beans.VetoableChangeListener l) {
 54  0
         vetoableChangeSupport.addVetoableChangeListener(l);
 55  0
     }
 56  
     
 57  
     /** Removes a VetoableChangeListener from the listener list.
 58  
      * @param l The listener to remove.
 59  
      */
 60  
     public void removeVetoableChangeListener(java.beans.VetoableChangeListener l) {
 61  0
         vetoableChangeSupport.removeVetoableChangeListener(l);
 62  0
     }
 63  
     
 64  
     /** Getter for property predicate.
 65  
      * @return Value of property predicate.
 66  
      */
 67  
     public String getPredicate() {
 68  0
         return this.predicate;
 69  
     }
 70  
     
 71  
     /** Setter for property predicate.
 72  
      * @param predicate New value of property predicate.
 73  
      *
 74  
      * @throws ProfileException
 75  
      */
 76  
     public void setPredicate(String predicate) throws ProfileException {
 77  18
         String oldPredicate = this.predicate;
 78  
         try {
 79  18
             vetoableChangeSupport.fireVetoableChange("predicate", oldPredicate, predicate);
 80  0
         } catch (Exception e) {
 81  0
             throw new ProfileException(null, e);
 82  18
         }
 83  18
         this.predicate = predicate;
 84  18
         propertyChangeSupport.firePropertyChange("predicate", oldPredicate, predicate);
 85  18
     }
 86  
     
 87  
     /** Getter for property name.
 88  
      * @return Value of property name.
 89  
      */
 90  
     public String getName() {
 91  6
         return this.name;
 92  
     }
 93  
     
 94  
     /** Setter for property name.
 95  
      * @param name New value of property name.
 96  
      *
 97  
      * @throws ProfileException
 98  
      */
 99  
     public void setName(String name) throws ProfileException {
 100  18
         String oldName = this.name;
 101  
         try {
 102  18
             vetoableChangeSupport.fireVetoableChange("name", oldName, name);
 103  0
         } catch (Exception e) {
 104  0
             throw new ProfileException(null, e);
 105  18
         }            
 106  18
         this.name = name;
 107  18
         propertyChangeSupport.firePropertyChange("name", oldName, name);
 108  18
     }
 109  
     
 110  
     /** Getter for property longName.
 111  
      * @return Value of property longName.
 112  
      */
 113  
     public String getLongName() {
 114  0
         return this.longName;
 115  
     }
 116  
     
 117  
     /** Setter for property longName.
 118  
      * @param longName New value of property longName.
 119  
      *
 120  
      * @throws ProfileException
 121  
      */
 122  
     public void setLongName(String longName) throws ProfileException {
 123  18
         String oldLongName = this.longName;
 124  
         try {
 125  18
             vetoableChangeSupport.fireVetoableChange("longName", oldLongName, longName);            
 126  0
         } catch (Exception e) {
 127  0
             throw new ProfileException(null, e);
 128  18
         }
 129  18
         this.longName = longName;
 130  18
         propertyChangeSupport.firePropertyChange("longName", oldLongName, longName);
 131  18
     }
 132  
     
 133  
     /** Getter for property usage.
 134  
      * @return Value of property usage.
 135  
      */
 136  
     public String getUsage() {
 137  2
         return this.usage;
 138  
     }
 139  
     
 140  
     /** Setter for property usage.
 141  
      * @param usage New value of property usage.
 142  
      *
 143  
      * @throws ProfileException
 144  
      */
 145  
     public void setUsage(String usage) throws ProfileException {
 146  18
         String oldUsage = this.usage;
 147  
         try {
 148  18
             vetoableChangeSupport.fireVetoableChange("usage", oldUsage, usage);
 149  0
         } catch (Exception e) {
 150  0
             throw new ProfileException(null, e);
 151  18
         }
 152  18
         this.usage = usage;
 153  18
         propertyChangeSupport.firePropertyChange("usage", oldUsage, usage);
 154  18
     }
 155  
     
 156  
     /** Getter for property min.
 157  
      * @return Value of property min.
 158  
      */
 159  
     public short getMin() {
 160  0
         return this.min;
 161  
     }
 162  
     
 163  
     /** Setter for property min.
 164  
      * @param min New value of property min.
 165  
      *
 166  
      * @throws ProfileException
 167  
      */
 168  
     public void setMin(short min) throws ProfileException {
 169  18
         short oldMin = this.min;
 170  
         try {
 171  18
             vetoableChangeSupport.fireVetoableChange("min", new Short(oldMin), new Short(min));
 172  0
         } catch (Exception e) {
 173  0
             throw new ProfileException(null, e);
 174  18
         }
 175  18
         this.min = min;
 176  18
         propertyChangeSupport.firePropertyChange("min", new Short(oldMin), new Short(min));
 177  18
     }
 178  
     
 179  
     /** Getter for property max.
 180  
      * @return Value of property max.
 181  
      */
 182  
     public short getMax() {
 183  0
         return this.max;
 184  
     }
 185  
     
 186  
     /** Setter for property max.
 187  
      * @param max New value of property max.
 188  
      *
 189  
      * @throws ProfileException
 190  
      */
 191  
     public void setMax(short max) throws ProfileException {
 192  18
         short oldMax = this.max;
 193  
         try {
 194  18
             vetoableChangeSupport.fireVetoableChange("max", new Short(oldMax), new Short(max));
 195  0
         } catch (Exception e) {
 196  0
             throw new ProfileException(null, e);
 197  18
         }
 198  18
         this.max = max;
 199  18
         propertyChangeSupport.firePropertyChange("max", new Short(oldMax), new Short(max));
 200  18
     }
 201  
     
 202  
 }