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
ListType.java 50% 84,6% 100% 81,8%
 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.cmp;
 11   
 
 12   
 import java.util.Set;
 13   
 
 14   
 import org.jbind.xml.base.FinalType;
 15   
 import org.jbind.xml.base.WhiteSpaceProcessing;
 16   
 import org.jbind.xml.core.cmp.IComponentVisitor;
 17   
 import org.jbind.xml.core.cmp.ISourceInfo;
 18   
 import org.jbind.xml.core.type.ISimpleType;
 19   
 import org.jbind.xml.msg.IConstraintViolations;
 20   
 import org.jbind.xml.msg.XmlException;
 21   
 import org.jbind.xml.msg.XmlMessages;
 22   
 
 23   
 public class ListType extends AbstractListType {
 24   
 
 25   
   private ISimpleType myItemType = null;
 26   
 
 27  23
   public ListType(ISourceInfo aSourceInfo, String aNamespace, String aName, String aRole, Set aFinalTypes) {
 28  23
     super(aSourceInfo, aNamespace, aName, aRole, aFinalTypes);
 29  23
     setBaseType(W3CTypes.anyListType);
 30  23
     getConstraints().setWhiteSpaceProcessing(WhiteSpaceProcessing.COLLAPSE);
 31   
   }
 32   
 
 33  23
   public void validate(IConstraintViolations aViolations) {
 34  23
     super.validate(aViolations);
 35  23
     if (null == myItemType) {
 36  0
       aViolations.add(XmlMessages.missingItemType(this));
 37   
     }
 38   
   }
 39   
 
 40  23
   public void setItemType(ISimpleType aSimpleType, IConstraintViolations aViolations) {
 41  23
     if (aSimpleType.isActive(FinalType.LIST)) {
 42  0
       aViolations.add(XmlMessages.itemTypeIsFinalizedForList(this));
 43   
     }
 44  23
     myItemType = aSimpleType;
 45   
   }
 46   
 
 47  237
   public ISimpleType getItemType() {
 48  237
     return myItemType;
 49   
   }
 50   
 
 51  49
   public void accept(IComponentVisitor aVisitor) throws XmlException {
 52  49
     aVisitor.visitListTypeStart(this);
 53  49
     visitSubComponents(aVisitor);
 54  49
     aVisitor.visitListTypeEnd(this);
 55   
   }
 56   
 
 57   
 }
 58