Clover coverage report - JBind Project
Coverage timestamp: Fr Mai 28 2004 11:17:36 CEST
file stats: LOC: 72   Methods: 10
NCLOC: 49   Classes: 1
This license of Clover is provided to support the development of JBind only. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover.
 
 Source file Conditionals Statements Methods TOTAL
NOTATIONData.java 0% 0% 0% 0%
 1   
 /*
 2   
  * JBind
 3   
  *
 4   
  * Copyright (c) by Stefan Wachter. All rights reserved.
 5   
  *
 6   
  * Usage, modification, and redistribution is subject to license terms that are
 7   
  * available at 'http://www.jbind.org'. The JBind license is like the
 8   
  * 'Apache Software License V 1.1'.
 9   
  */
 10   
 package org.jbind.xml.instance.data;
 11   
 
 12   
 import org.jbind.xml.base.IQName;
 13   
 import org.jbind.xml.base.QName;
 14   
 import org.jbind.xml.core.data.IAnyTypeData;
 15   
 import org.jbind.xml.core.data.INOTATIONData;
 16   
 import org.jbind.xml.msg.IConstraintViolations;
 17   
 import org.jbind.xml.msg.XmlException;
 18   
 import org.jbind.xml.msg.XmlMessages;
 19   
 
 20   
 public class NOTATIONData extends AbstractSimpleData implements INOTATIONData {
 21   
 
 22   
   private IQName myValue = null;
 23   
 
 24  0
   public NOTATIONData() {}
 25   
 
 26  0
   protected void doAccept(String aString) throws XmlException {
 27  0
     super.doAccept(aString);
 28  0
     myValue = QName.create(aString, getImpl_().getPrefixToNamespaceMapping());
 29  0
     if (null == myValue) {
 30  0
       throw new XmlException(XmlMessages.invalidQName(aString, getImpl_()));
 31   
     }
 32   
   }
 33   
 
 34  0
   public int getLength() {
 35  0
     return String.valueOf(myValue).length();
 36   
   }
 37   
 
 38  0
   public String getCanonicalForm_() {
 39  0
     return String.valueOf(myValue);
 40   
   }
 41   
 
 42  0
   public boolean simpleStorageValueEquals(IAnyTypeData aData) {
 43  0
     return (aData instanceof INOTATIONData) && myValue.equals(((INOTATIONData)aData).getQName());
 44   
   }
 45   
 
 46  0
   public int simpleStorageValueHashCode() {
 47  0
     return myValue.hashCode();
 48   
   }
 49   
 
 50  0
   public IQName getQName() {
 51  0
     return myValue;
 52   
   }
 53   
 
 54  0
   public void setQName(IQName aNewValue) throws XmlException {
 55  0
     IQName oldValue = myValue;
 56  0
     myValue = aNewValue;
 57  0
     IConstraintViolations violations = completeSimpleStorageAssignment_();
 58  0
     if (!violations.isEmpty()) {
 59  0
       myValue = oldValue;
 60  0
       throw new XmlException(violations);
 61   
     }
 62   
   }
 63   
 
 64  0
   public Object getSimpleStorageObject() {
 65  0
     return myValue;
 66   
   }
 67   
 
 68  0
   public void setSimpleStorageObject(Object aValue) {
 69  0
     myValue = (IQName)aValue;
 70   
   }
 71   
 }
 72