Clover coverage report - JBind Project
Coverage timestamp: Fr Mai 28 2004 11:17:36 CEST
file stats: LOC: 66   Methods: 6
NCLOC: 43   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
DocumentationElement.java 83,3% 83,3% 66,7% 80%
 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.schema.element;
 11   
 
 12   
 import java.util.Iterator;
 13   
 
 14   
 import org.jbind.xml.base.IAttribute;
 15   
 import org.jbind.xml.base.ILanguage;
 16   
 import org.jbind.xml.base.INamespaces;
 17   
 import org.jbind.xml.instance.data.Language;
 18   
 import org.jbind.xml.msg.XmlException;
 19   
 
 20   
 public class DocumentationElement extends Element implements IDocumentationElement {
 21   
 
 22   
   private ILanguage myLanguage = null;
 23   
 
 24  318
   public DocumentationElement(CreationParams aCreationParams) throws XmlException {
 25  318
     super(aCreationParams);
 26   
   }
 27   
 
 28  188
   protected IAttribute doCreateAttribute(ACParams anACParams) throws XmlException {
 29  188
     IAttribute res = null;
 30  188
     String an = NameUtil.getSchemaAttributeName(anACParams);
 31  188
     if (INamespaces.XML.equals(anACParams.namespace) && "lang".equals(anACParams.localName)) {
 32  8
       res = new Attribute(anACParams);
 33  8
       myLanguage = Language.createLanguage(res.getStringValue());
 34  180
     } else if ("source".equals(an)) {
 35  180
       res = new Attribute(anACParams);
 36   
     } else {
 37  0
       res = super.doCreateAttribute(anACParams);
 38   
     }
 39  188
     return res;
 40   
   }
 41   
 
 42   
 
 43  0
   public IElement doCreateChild(CreationParams aCreationParams) throws XmlException {
 44  0
     return new GenericSchemaElement(aCreationParams);
 45   
   }
 46   
 
 47   
 
 48  0
   public String getSource() {
 49  0
     return getAttributes().getStringValue(INamespaces.XML_SCHEMA, "source");
 50   
   }
 51   
 
 52   
 
 53  187
   public ILanguage getLanguage() {
 54  187
     return myLanguage;
 55   
   }
 56   
 
 57  3
   public String getText() {
 58  3
     StringBuffer sb = new StringBuffer();
 59  3
     for (Iterator i = iterChildrenByClass(IText.class); i.hasNext(); ) {
 60  3
       IText t = (IText)i.next();
 61  3
       sb.append(t.getString());
 62   
     }
 63  3
     return sb.toString();
 64   
   }
 65   
 }
 66