Clover coverage report - JBind Project
Coverage timestamp: Fr Mai 28 2004 11:17:36 CEST
file stats: LOC: 75   Methods: 10
NCLOC: 51   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
AnyURIData.java 0% 10,5% 20% 11,4%
 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.WhiteSpaceProcessing;
 13   
 import org.jbind.xml.core.data.IAnyTypeData;
 14   
 import org.jbind.xml.core.data.IAnyURIData;
 15   
 import org.jbind.xml.msg.IConstraintViolations;
 16   
 import org.jbind.xml.msg.XmlException;
 17   
 import org.jbind.xml.msg.XmlMessages;
 18   
 
 19   
 public class AnyURIData extends AbstractSimpleData implements IAnyURIData {
 20   
 
 21   
   private String myValue = null;
 22   
 
 23  7
   public AnyURIData() {}
 24   
 
 25  7
   protected void doAccept(String aString) throws XmlException {
 26  7
     super.doAccept(aString);
 27  7
     myValue = aString;
 28   
   }
 29   
 
 30  0
   public int getLength() {
 31  0
     return myValue.length();
 32   
   }
 33   
 
 34  0
   public String getCanonicalForm_() {
 35  0
     return myValue;
 36   
   }
 37   
 
 38  0
   public boolean simpleStorageValueEquals(IAnyTypeData aData) {
 39  0
     return (aData instanceof IAnyURIData) && myValue.equals(((IAnyURIData)aData).getCanonicalForm_());
 40   
   }
 41   
 
 42  0
   public int simpleStorageValueHashCode() {
 43  0
     return myValue.hashCode();
 44   
   }
 45   
 
 46  0
   public String getString() {
 47  0
     return myValue;
 48   
   }
 49   
 
 50  0
   public void setString(String aNewValue) throws XmlException {
 51  0
     WhiteSpaceProcessing wsp = getType_().getConstraints().getWhiteSpaceProcessing();
 52  0
     if (null != wsp) {
 53  0
       if (!wsp.check(aNewValue)) {
 54  0
         throw new XmlException(XmlMessages.whiteSpaceProcessingNotSatisfied(aNewValue, null));
 55   
       }
 56   
     }
 57  0
     String oldValue = myValue;
 58  0
     myValue = aNewValue;
 59  0
     IConstraintViolations violations = completeSimpleStorageAssignment_();
 60  0
     if (!violations.isEmpty()) {
 61  0
       myValue = oldValue;
 62  0
       throw new XmlException(violations);
 63   
     }
 64   
   }
 65   
 
 66  0
   public Object getSimpleStorageObject() {
 67  0
     return myValue;
 68   
   }
 69   
 
 70  0
   public void setSimpleStorageObject(Object aValue) {
 71  0
     myValue = (String)aValue;
 72   
   }
 73   
 
 74   
 }
 75