Coverage Report - ca.uhn.hl7v2.conf.spec.RuntimeProfile
 
Classes in this File Line Coverage Branch Coverage Complexity
RuntimeProfile
17%
24/139
N/A
1.848
 
 1  
 package ca.uhn.hl7v2.conf.spec;
 2  
 
 3  
 import ca.uhn.hl7v2.conf.spec.usecase.UseCase;
 4  
 import ca.uhn.hl7v2.conf.spec.message.StaticDef;
 5  
 import ca.uhn.hl7v2.conf.ProfileException;
 6  
 
 7  
 /**
 8  
  * A conformance specification (see HL7 2.5 section 2.12).  
 9  
  * @author Bryan Tripp
 10  
  */
 11  
 public class RuntimeProfile {
 12  
     
 13  
     private Conformance conformance;
 14  
     /** Holds value of property conformanceType. */
 15  
     private String conformanceType;
 16  
     private Encoding[] encodings;
 17  
     /** Holds value of property HL7OID. */
 18  
     private String HL7OID;
 19  
     /** Holds value of property HL7Version. */
 20  
     private String HL7Version;
 21  
         
 22  
     private String impNote;
 23  
     
 24  
     /** Holds value of property message. */
 25  
     private StaticDef message;
 26  
     
 27  
     /** Holds value of property orgName. */
 28  
     private String orgName;
 29  
     
 30  
     /** Utility field used by bound properties. */
 31  19
     private java.beans.PropertyChangeSupport propertyChangeSupport =  new java.beans.PropertyChangeSupport(this);
 32  
     
 33  
     /** Holds value of property role. */
 34  
     private String role;
 35  
     
 36  
     /** Holds value of property specName. */
 37  
     private String specName;
 38  
     
 39  
     /** Holds value of property specVersion. */
 40  
     private String specVersion;
 41  
     
 42  
     /** Holds value of property status. */
 43  
     private String status;
 44  
     
 45  
     private UseCase useCase;
 46  
     
 47  
     /** Utility field used by constrained properties. */
 48  19
     private java.beans.VetoableChangeSupport vetoableChangeSupport =  new java.beans.VetoableChangeSupport(this);
 49  
         private String name;
 50  
     
 51  
     /** Creates a new instance of Specification */
 52  19
     public RuntimeProfile() {
 53  19
     }
 54  
     
 55  
     /** Adds a PropertyChangeListener to the listener list.
 56  
      * @param l The listener to add.
 57  
      */
 58  
     public void addPropertyChangeListener(java.beans.PropertyChangeListener l) {
 59  0
         propertyChangeSupport.addPropertyChangeListener(l);
 60  0
     }
 61  
     
 62  
     /** Adds a VetoableChangeListener to the listener list.
 63  
      * @param l The listener to add.
 64  
      */
 65  
     public void addVetoableChangeListener(java.beans.VetoableChangeListener l) {
 66  0
         vetoableChangeSupport.addVetoableChangeListener(l);
 67  0
     }
 68  
     
 69  
     /** Getter for property conformance.
 70  
      * @return Value of property conformance.
 71  
      */
 72  
     public Conformance getConformance() {
 73  0
         return this.conformance;
 74  
     }
 75  
     
 76  
     /** Getter for property conformanceType.
 77  
      * @return Value of property conformanceType.
 78  
      */
 79  
     public String getConformanceType() {
 80  0
         return this.conformanceType;
 81  
     }
 82  
     
 83  
     /** Indexed getter for property encodings.
 84  
      * @param index Index of the property.
 85  
      * @return Value of the property at <CODE>index</CODE>.
 86  
      */
 87  
     public Encoding getEncodings(int index) {
 88  0
         return this.encodings[index];
 89  
     }
 90  
     
 91  
     /** Getter for property HL7OID.
 92  
      * @return Value of property HL7OID.
 93  
      */
 94  
     public String getHL7OID() {
 95  0
         return this.HL7OID;
 96  
     }
 97  
     
 98  
     /** Getter for property HL7Version.
 99  
      * @return Value of property HL7Version.
 100  
      */
 101  
     public String getHL7Version() {
 102  1
         return this.HL7Version;
 103  
     }
 104  
     
 105  
     /** Getter for property impNote.
 106  
      * @return Value of property impNote.
 107  
      */
 108  
     public String getImpNote() {
 109  0
         return this.impNote;
 110  
     }
 111  
     
 112  
     /** Getter for property message.
 113  
      * @return Value of property message.
 114  
      */
 115  
     public StaticDef getMessage() {
 116  23
         return this.message;
 117  
     }
 118  
     
 119  
     /** Getter for property orgName.
 120  
      * @return Value of property orgName.
 121  
      */
 122  
     public String getOrgName() {
 123  0
         return this.orgName;
 124  
     }
 125  
     
 126  
     /** Getter for property role.
 127  
      * @return Value of property role.
 128  
      */
 129  
     public String getRole() {
 130  0
         return this.role;
 131  
     }
 132  
     
 133  
     /** Getter for property specName.
 134  
      * @return Value of property specName.
 135  
      */
 136  
     public String getSpecName() {
 137  0
         return this.specName;
 138  
     }
 139  
     
 140  
     /** Getter for property specVersion.
 141  
      * @return Value of property specVersion.
 142  
      */
 143  
     public String getSpecVersion() {
 144  0
         return this.specVersion;
 145  
     }
 146  
     
 147  
     /** Getter for property status.
 148  
      * @return Value of property status.
 149  
      */
 150  
     public String getStatus() {
 151  0
         return this.status;
 152  
     }
 153  
     
 154  
     /** Getter for property useCase.
 155  
      * @return Value of property useCase.
 156  
      */
 157  
     public UseCase getUseCase() {
 158  0
         return this.useCase;
 159  
     }
 160  
     
 161  
     /** Removes a PropertyChangeListener from the listener list.
 162  
      * @param l The listener to remove.
 163  
      */
 164  
     public void removePropertyChangeListener(java.beans.PropertyChangeListener l) {
 165  0
         propertyChangeSupport.removePropertyChangeListener(l);
 166  0
     }
 167  
     
 168  
     /** Removes a VetoableChangeListener from the listener list.
 169  
      * @param l The listener to remove.
 170  
      */
 171  
     public void removeVetoableChangeListener(java.beans.VetoableChangeListener l) {
 172  0
         vetoableChangeSupport.removeVetoableChangeListener(l);
 173  0
     }
 174  
     
 175  
     /** Setter for property conformance.
 176  
      * @param conformance New value of property conformance.
 177  
      *
 178  
      * @throws ProfileException
 179  
      */
 180  
     public void setConformance(Conformance conformance) throws ProfileException {
 181  0
         Conformance oldConformance = this.conformance;
 182  
         try {
 183  0
             vetoableChangeSupport.fireVetoableChange("conformance", oldConformance, conformance);
 184  0
         } catch (Exception e) {
 185  0
             throw new ProfileException(null, e);
 186  0
         }
 187  0
         this.conformance = conformance;
 188  0
         propertyChangeSupport.firePropertyChange("conformance", oldConformance, conformance);
 189  0
     }
 190  
     
 191  
     /** Setter for property conformanceType.
 192  
      * @param conformanceType New value of property conformanceType.
 193  
      *
 194  
      * @throws ProfileException
 195  
      */
 196  
     public void setConformanceType(String conformanceType) throws ProfileException {
 197  0
         String oldConformanceType = this.conformanceType;
 198  
         try {
 199  0
             vetoableChangeSupport.fireVetoableChange("conformanceType", oldConformanceType, conformanceType);
 200  0
         } catch (Exception e) {
 201  0
             throw new ProfileException(null, e);
 202  0
         }
 203  0
         this.conformanceType = conformanceType;
 204  0
         propertyChangeSupport.firePropertyChange("conformanceType", oldConformanceType, conformanceType);
 205  0
     }
 206  
     
 207  
     /** Indexed setter for property encodings.
 208  
      * @param index Index of the property.
 209  
      * @param encodings New value of the property at <CODE>index</CODE>.
 210  
      *
 211  
      * @throws ProfileException
 212  
      */
 213  
     public void setEncodings(int index, Encoding encodings) throws ProfileException {
 214  0
         Encoding oldEncodings = this.encodings[index];
 215  0
         this.encodings[index] = encodings;
 216  
         try {
 217  0
             vetoableChangeSupport.fireVetoableChange("encodings", null, null );
 218  
         }
 219  0
         catch(java.beans.PropertyVetoException vetoException ) {
 220  0
             this.encodings[index] = oldEncodings;
 221  0
             throw new ProfileException(null, vetoException);
 222  0
         }
 223  0
         propertyChangeSupport.firePropertyChange("encodings", null, null );
 224  0
     }
 225  
     
 226  
     /** Setter for property HL7OID.
 227  
      * @param HL7OID New value of property HL7OID.
 228  
      *
 229  
      * @throws ProfileException
 230  
      */
 231  
     public void setHL7OID(String HL7OID) throws ProfileException {
 232  0
         String oldHL7OID = this.HL7OID;
 233  
         try {
 234  0
             vetoableChangeSupport.fireVetoableChange("HL7OID", oldHL7OID, HL7OID);
 235  0
         } catch (Exception e) {
 236  0
             throw new ProfileException(null, e);
 237  0
         }
 238  0
         this.HL7OID = HL7OID;
 239  0
         propertyChangeSupport.firePropertyChange("HL7OID", oldHL7OID, HL7OID);
 240  0
     }
 241  
     
 242  
     /** Setter for property HL7Version.
 243  
      * @param HL7Version New value of property HL7Version.
 244  
      *
 245  
      * @throws ProfileException
 246  
      */
 247  
     public void setHL7Version(String HL7Version) throws ProfileException {
 248  19
         String oldHL7Version = this.HL7Version;
 249  
         try {
 250  19
             vetoableChangeSupport.fireVetoableChange("HL7Version", oldHL7Version, HL7Version);
 251  0
         } catch (Exception e) {
 252  0
             throw new ProfileException(null, e);
 253  19
         }
 254  19
         this.HL7Version = HL7Version;
 255  19
         propertyChangeSupport.firePropertyChange("HL7Version", oldHL7Version, HL7Version);
 256  19
     }
 257  
     
 258  
     /** Setter for property impNote.
 259  
      * @param impNote New value of property impNote.
 260  
      *
 261  
      * @throws ProfileException
 262  
      */
 263  
     public void setImpNote(String impNote) throws ProfileException {
 264  0
         String oldImpNote = this.impNote;
 265  
         try {
 266  0
             vetoableChangeSupport.fireVetoableChange("impNote", oldImpNote, impNote);
 267  0
         } catch (Exception e) {
 268  0
             throw new ProfileException(null, e);
 269  0
         }
 270  0
         this.impNote = impNote;
 271  0
         propertyChangeSupport.firePropertyChange("impNote", oldImpNote, impNote);
 272  0
     }
 273  
     
 274  
     /** Setter for property message.
 275  
      * @param message New value of property message.
 276  
      *
 277  
      * @throws ProfileException
 278  
      */
 279  
     public void setMessage(StaticDef message) throws ProfileException {
 280  19
         StaticDef oldMessage = this.message;
 281  
         try {
 282  19
             vetoableChangeSupport.fireVetoableChange("message", oldMessage, message);
 283  0
         } catch (Exception e) {
 284  0
             throw new ProfileException(null, e);
 285  19
         }
 286  19
         this.message = message;
 287  19
         propertyChangeSupport.firePropertyChange("message", oldMessage, message);
 288  19
     }
 289  
     
 290  
     public void setName(String theName) throws ProfileException {
 291  18
         String oldOrgName = this.name;
 292  
         try {
 293  18
             vetoableChangeSupport.fireVetoableChange("name", oldOrgName, theName);
 294  0
         } catch (Exception e) {
 295  0
             throw new ProfileException(null, e);
 296  18
         }
 297  18
         this.name = theName;
 298  18
         propertyChangeSupport.firePropertyChange("name", oldOrgName, theName);
 299  18
         }
 300  
     
 301  
     /**
 302  
          * @return the name for this profile (as drawn from the MetaData tag within the overall profile tag)
 303  
          */
 304  
         public String getName() {
 305  0
                 return name;
 306  
         }
 307  
 
 308  
         /** Setter for property orgName.
 309  
      * @param orgName New value of property orgName.
 310  
      *
 311  
      * @throws ProfileException
 312  
      */
 313  
     public void setOrgName(String orgName) throws ProfileException {
 314  0
         String oldOrgName = this.orgName;
 315  
         try {
 316  0
             vetoableChangeSupport.fireVetoableChange("orgName", oldOrgName, orgName);
 317  0
         } catch (Exception e) {
 318  0
             throw new ProfileException(null, e);
 319  0
         }
 320  0
         this.orgName = orgName;
 321  0
         propertyChangeSupport.firePropertyChange("orgName", oldOrgName, orgName);
 322  0
     }
 323  
     
 324  
     /** Setter for property role.
 325  
      * @param role New value of property role.
 326  
      *
 327  
      * @throws ProfileException
 328  
      */
 329  
     public void setRole(String role) throws ProfileException {
 330  0
         String oldRole = this.role;
 331  
         try {
 332  0
             vetoableChangeSupport.fireVetoableChange("role", oldRole, role);
 333  0
         } catch (Exception e) {
 334  0
             throw new ProfileException(null, e);
 335  0
         }
 336  0
         this.role = role;
 337  0
         propertyChangeSupport.firePropertyChange("role", oldRole, role);
 338  0
     }
 339  
     
 340  
     /** Setter for property specName.
 341  
      * @param specName New value of property specName.
 342  
      *
 343  
      * @throws ProfileException
 344  
      */
 345  
     public void setSpecName(String specName) throws ProfileException {
 346  0
         String oldSpecName = this.specName;
 347  
         try {
 348  0
             vetoableChangeSupport.fireVetoableChange("specName", oldSpecName, specName);
 349  0
         } catch (Exception e) {
 350  0
             throw new ProfileException(null, e);
 351  0
         }
 352  0
         this.specName = specName;
 353  0
         propertyChangeSupport.firePropertyChange("specName", oldSpecName, specName);
 354  0
     }
 355  
     
 356  
     /** Setter for property specVersion.
 357  
      * @param specVersion New value of property specVersion.
 358  
      *
 359  
      * @throws ProfileException
 360  
      */
 361  
     public void setSpecVersion(String specVersion) throws ProfileException {
 362  0
         String oldSpecVersion = this.specVersion;
 363  
         try {
 364  0
             vetoableChangeSupport.fireVetoableChange("specVersion", oldSpecVersion, specVersion);
 365  0
         } catch (Exception e) {
 366  0
             throw new ProfileException(null, e);
 367  0
         }
 368  0
         this.specVersion = specVersion;
 369  0
         propertyChangeSupport.firePropertyChange("specVersion", oldSpecVersion, specVersion);
 370  0
     }
 371  
     
 372  
     /** Setter for property status.
 373  
      * @param status New value of property status.
 374  
      *
 375  
      * @throws ProfileException
 376  
      */
 377  
     public void setStatus(String status) throws ProfileException {
 378  0
         String oldStatus = this.status;
 379  
         try {
 380  0
             vetoableChangeSupport.fireVetoableChange("status", oldStatus, status);
 381  0
         } catch (Exception e) {
 382  0
             throw new ProfileException(null, e);
 383  0
         }
 384  0
         this.status = status;
 385  0
         propertyChangeSupport.firePropertyChange("status", oldStatus, status);
 386  0
     }
 387  
 
 388  
         /** Setter for property useCase.
 389  
      * @param useCase New value of property useCase.
 390  
      *
 391  
      * @throws ProfileException
 392  
      */
 393  
     public void setUseCase(UseCase useCase) throws ProfileException {
 394  0
         UseCase oldUseCase = this.useCase;
 395  
         try {
 396  0
             vetoableChangeSupport.fireVetoableChange("useCase", oldUseCase, useCase);
 397  0
         } catch (Exception e) {
 398  0
             throw new ProfileException(null, e);
 399  0
         }
 400  0
         this.useCase = useCase;
 401  0
         propertyChangeSupport.firePropertyChange("useCase", oldUseCase, useCase);
 402  0
     }
 403  
     
 404  
 }