Clover coverage report - JBind Project
Coverage timestamp: Fr Mai 28 2004 11:17:36 CEST
file stats: LOC: 59   Methods: 5
NCLOC: 39   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
AnnotationElement.java 87,5% 94,4% 100% 93,5%
 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.ILanguage;
 15   
 import org.jbind.xml.core.cmp.IDocumentation;
 16   
 import org.jbind.xml.msg.XmlException;
 17   
 
 18   
 public class AnnotationElement extends OpenAttributes implements IAnnotationElement {
 19   
 
 20  329
   public AnnotationElement(CreationParams aCreationParams) {
 21  329
     super(aCreationParams);
 22   
   }
 23   
 
 24   
 
 25  386
   public IElement doCreateChild(CreationParams aCreationParams) throws XmlException {
 26  386
     IElement res = null;
 27  386
     String componentName = NameUtil.getSchemaComponentName(aCreationParams);
 28  386
     if ("appinfo".equals(componentName)) {
 29  68
       res = new AppInfoElement(aCreationParams);
 30  318
     } else if ("documentation".equals(componentName)) {
 31  318
       res = new DocumentationElement(aCreationParams);
 32   
     } else {
 33  0
       res = super.doCreateChild(aCreationParams);
 34   
     }
 35  386
     return res;
 36   
   }
 37   
 
 38   
 
 39  92
   public Iterator iterAppInfos() {
 40  92
     return iterChildrenByClass(IAppInfoElement.class);
 41   
   }
 42   
 
 43  98
   public Iterator iterDocumentations() {
 44  98
     return iterChildrenByClass(IDocumentationElement.class);
 45   
   }
 46   
 
 47  98
   public IDocumentation getDocumentation(ILanguage aLanguage) {
 48  98
     IDocumentation res = null;
 49  98
     for (Iterator i = iterDocumentations(); i.hasNext(); ) {
 50  92
       IDocumentation doc = (IDocumentation)i.next();
 51  92
       if (((null == doc.getLanguage()) && (null == aLanguage)) || ((null != doc.getLanguage()) && doc.getLanguage().equals(aLanguage))) {
 52  3
         res = doc;
 53  3
         break;
 54   
       }
 55   
     }
 56  98
     return res;
 57   
   }
 58   
 }
 59