Clover coverage report - JBind Project
Coverage timestamp: Fr Mai 28 2004 11:17:36 CEST
file stats: LOC: 69   Methods: 8
NCLOC: 47   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
RestrictedListType.java 50% 92,9% 87,5% 87,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.cmp;
 11   
 
 12   
 import java.util.HashSet;
 13   
 import java.util.Set;
 14   
 
 15   
 import org.jbind.xml.base.FinalType;
 16   
 import org.jbind.xml.core.bridge.IDataImpl;
 17   
 import org.jbind.xml.core.cmp.IComponentVisitor;
 18   
 import org.jbind.xml.core.cmp.ISourceInfo;
 19   
 import org.jbind.xml.core.constraint.ICheckContext;
 20   
 import org.jbind.xml.core.data.IAnyTypeData;
 21   
 import org.jbind.xml.core.type.IAnyType;
 22   
 import org.jbind.xml.core.type.IListType;
 23   
 import org.jbind.xml.core.type.ISimpleType;
 24   
 import org.jbind.xml.msg.IConstraintViolations;
 25   
 import org.jbind.xml.msg.XmlException;
 26   
 
 27   
 public class RestrictedListType extends RestrictedSimpleType implements IListType {
 28   
 
 29  11
   private static Set addFinalList(Set aSet) {
 30  11
     Set res = new HashSet(17);
 31  11
     if (null != aSet) {
 32  11
       res.addAll(aSet);
 33   
     }
 34  11
     res.add(FinalType.LIST);
 35  11
     return res;
 36   
   }
 37   
 
 38  11
   public RestrictedListType(ISourceInfo aSourceInfo, String aNamespace, String aName, String aRole, Set aFinalTypes, IConstraintViolations aViolations) {
 39  11
     super(aSourceInfo, aNamespace, aName, aRole, addFinalList(aFinalTypes), aViolations);
 40   
   }
 41   
 
 42  23
   public void accept(IComponentVisitor aVisitor) throws XmlException {
 43  23
     aVisitor.visitListTypeStart(this);
 44  23
     visitSubComponents(aVisitor);
 45  23
     aVisitor.visitListTypeEnd(this);
 46   
   }
 47   
 
 48  19
   public ISimpleType getItemType() {
 49  19
     return ((IListType)getBaseType()).getItemType();
 50   
   }
 51   
 
 52  0
   public IAnyTypeData createItem(IDataImpl anImpl) throws XmlException {
 53  0
     return ((IListType)getBaseType()).createItem(anImpl);
 54   
   }
 55   
 
 56  12
   public void checkEnclosedConstraints(ICheckContext aContext) {
 57  12
     getBaseType().checkEnclosedConstraints(aContext);
 58   
   }
 59   
 
 60  6
   public final IAnyType getInstanceType() {
 61  6
     return this;
 62   
   }
 63   
 
 64  10
   protected boolean isUnion() {
 65  10
     return false;
 66   
   }
 67   
 
 68   
 }
 69