Clover coverage report - JBind Project
Coverage timestamp: Fr Mai 28 2004 11:17:36 CEST
file stats: LOC: 58   Methods: 5
NCLOC: 38   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
ComplexContentModelDesc.java 50% 55,6% 80% 58,6%
 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.msg.XmlException;
 14   
 
 15   
 public class ComplexContentModelDesc extends ContentModelDesc implements IComplexContentModelDesc {
 16   
 
 17   
   private Boolean myIsMixed;
 18   
 
 19   
 
 20  165
   public ComplexContentModelDesc(CreationParams aCreationParams) {
 21  165
     super(aCreationParams);
 22   
   }
 23   
 
 24   
 
 25  0
   protected IAttribute doCreateAttribute(ACParams anACParams) throws XmlException {
 26  0
     IAttribute res = null;
 27  0
     String an = NameUtil.getSchemaAttributeName(anACParams);
 28  0
     if ("mixed".equals(an)) {
 29  0
       res = new BooleanAttribute(anACParams);
 30  0
       myIsMixed = new Boolean(res.getBoolean());
 31   
     } else {
 32  0
       res = super.doCreateAttribute(anACParams);
 33   
     }
 34  0
     return res;
 35   
   }
 36   
 
 37  165
   public IElement doCreateChild(CreationParams aCreationParams) throws XmlException {
 38  165
     IElement res = null;
 39  165
     String componentName = NameUtil.getSchemaComponentName(aCreationParams);
 40  165
     if ("extension".equals(componentName)) {
 41  89
       res = new ComplexExtensionDerivation(aCreationParams);
 42  76
     } else if ("restriction".equals(componentName)) {
 43  76
       res = new ComplexRestrictionDerivation(aCreationParams);
 44   
     } else {
 45  0
       res = super.doCreateChild(aCreationParams);
 46   
     }
 47  165
     return res;
 48   
   }
 49   
 
 50  161
   public Boolean isMixed() {
 51  161
     return myIsMixed;
 52   
   }
 53   
 
 54  1440
   public boolean isComplex() {
 55  1440
     return true;
 56   
   }
 57   
 }
 58