Clover coverage report - JBind Project
Coverage timestamp: Fr Mai 28 2004 11:17:36 CEST
file stats: LOC: 63   Methods: 5
NCLOC: 45   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
AppInfoElement.java 83,3% 60% 40% 64,3%
 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 org.jbind.xml.base.IAttribute;
 13   
 import org.jbind.xml.core.cmp.IAppInfoVisitor;
 14   
 import org.jbind.xml.msg.XmlException;
 15   
 
 16   
 public class AppInfoElement extends Element implements IAppInfoElement {
 17   
 
 18  68
   public AppInfoElement(CreationParams aCreationParams) throws XmlException {
 19  68
     super(aCreationParams);
 20   
   }
 21   
 
 22  492
   public IElement doCreateChild(CreationParams aCreationParams) throws XmlException {
 23  492
     IElement res = null;
 24  492
     String componentName = NameUtil.getExtensionElementName(aCreationParams);
 25  492
     if ("key".equals(componentName)) {
 26  4
       res = new TypeKeyConstraintElement(aCreationParams);
 27  488
     } else if ("unique".equals(componentName)) {
 28  4
       res = new TypeUniqueConstraintElement(aCreationParams);
 29  484
     } else if ("keyref".equals(componentName)) {
 30  8
       res = new TypeKeyRefConstraintElement(aCreationParams);
 31  476
     } else if ("xPathConstraint".equals(componentName)) {
 32  2
       res = new XPathConstraintElement(aCreationParams);
 33  474
     } else if ("xPathMethod".equals(componentName)) {
 34  12
       res = new XPathMethodElement(aCreationParams);
 35   
     } else {
 36  462
       res = new GenericSchemaElement(aCreationParams);
 37   
     }
 38  492
     return res;
 39   
   }
 40   
 
 41  0
   protected IAttribute doCreateAttribute(ACParams anACParams) throws XmlException {
 42  0
     IAttribute res = null;
 43  0
     String an = NameUtil.getSchemaAttributeName(anACParams);
 44  0
     if ("source".equals(an)) {
 45  0
       res = new Attribute(anACParams);
 46   
     } else {
 47  0
       res = super.doCreateAttribute(anACParams);
 48   
     }
 49  0
     return res;
 50   
   }
 51   
 
 52  0
   public String getSource() {
 53  0
     return getAttributes().getStringValue("source");
 54   
   }
 55   
 
 56  0
   public void acceptAppInfoVisitor(IAppInfoVisitor aVisitor) {
 57  0
     aVisitor.startVisitAppInfo(this);
 58  0
     visitChildren(aVisitor);
 59  0
     aVisitor.endVisitAppInfo(this);
 60   
   }
 61   
 
 62   
 }
 63