Coverage Report - org.apache.ws.scout.registry.infomodel.ClassificationSchemeImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
ClassificationSchemeImpl
0%
0/27
0%
0/4
0
 
 1  
 /*
 2  
  * Copyright 2001-2004 The Apache Software Foundation.
 3  
  *
 4  
  * Licensed under the Apache License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  *      http://www.apache.org/licenses/LICENSE-2.0
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 
 17  
 package org.apache.ws.scout.registry.infomodel;
 18  
 
 19  
 import java.util.ArrayList;
 20  
 import java.util.Collection;
 21  
 import java.util.Iterator;
 22  
 
 23  
 import javax.xml.registry.JAXRException;
 24  
 import javax.xml.registry.LifeCycleManager;
 25  
 import javax.xml.registry.UnsupportedCapabilityException;
 26  
 import javax.xml.registry.infomodel.ClassificationScheme;
 27  
 import javax.xml.registry.infomodel.Concept;
 28  
 
 29  
 /**
 30  
  * Implements JAXR Interface.
 31  
  * For futher details, look into the JAXR API Javadoc.
 32  
  *
 33  
  * @author <a href="mailto:anil@apache.org">Anil Saldhana</a>
 34  
  * @author <a href="mailto:geirm@apache.org">Geir Magnusson Jr.</a>
 35  
  */
 36  
 public class ClassificationSchemeImpl
 37  
         extends RegistryEntryImpl
 38  
         implements ClassificationScheme
 39  
 {
 40  
 
 41  0
     private Collection<Concept> childConcepts = new ArrayList<Concept>();
 42  
 
 43  
     //private int valueType = 1; KS: not used.
 44  
 
 45  0
     private boolean external = false;
 46  
     
 47  
     /**
 48  
      * Creates a new instance of ClassificationSchemeImpl
 49  
      */
 50  
     public ClassificationSchemeImpl(LifeCycleManager lifeCycleManager)
 51  
     {
 52  0
         super(lifeCycleManager);
 53  0
     }
 54  
 
 55  
     public void addChildConcept(Concept concept)
 56  
             throws JAXRException
 57  
     {
 58  0
         childConcepts.add(concept);
 59  0
     }
 60  
 
 61  
     public void addChildConcepts(Collection collection)
 62  
             throws JAXRException
 63  
     {
 64  0
         childConcepts.addAll(collection);
 65  0
     }
 66  
 
 67  
     public int getChildConceptCount()
 68  
             throws JAXRException
 69  
     {
 70  0
         return childConcepts.size();
 71  
     }
 72  
 
 73  
     public Collection getChildrenConcepts() throws JAXRException
 74  
     {
 75  0
         return childConcepts;
 76  
     }
 77  
 
 78  
     public Collection getDescendantConcepts() throws JAXRException
 79  
     {
 80  0
         Collection<Concept> coll = new ArrayList<Concept>();
 81  0
         Iterator iter = childConcepts.iterator();
 82  0
         while(iter != null && iter.hasNext())
 83  
         {
 84  0
             ConceptImpl c = (ConceptImpl)iter.next();
 85  0
             coll.add(c);
 86  0
             coll.addAll(c.getDescendantConcepts());
 87  0
         }
 88  0
         return coll;
 89  
     }
 90  
 
 91  
     public int getValueType()
 92  
         throws JAXRException
 93  
     {
 94  
         /*
 95  
          * we are a level 0 provider
 96  
          */
 97  
 
 98  0
         throw new UnsupportedCapabilityException();
 99  
     }
 100  
 
 101  
     protected void setExternal(boolean b) {
 102  0
         this.external = b;
 103  0
     }
 104  
 
 105  
     public boolean isExternal() throws JAXRException
 106  
     {
 107  0
         return this.external;
 108  
     }
 109  
 
 110  
     public void removeChildConcept(Concept concept)
 111  
             throws JAXRException
 112  
     {
 113  0
         this.childConcepts.remove(concept);
 114  0
     }
 115  
 
 116  
     public void removeChildConcepts(Collection collection)
 117  
             throws JAXRException
 118  
     {
 119  0
         this.childConcepts.removeAll(collection);
 120  0
     }
 121  
 
 122  
     public void setValueType(int param)
 123  
         throws JAXRException
 124  
     {
 125  
         /*
 126  
          * we are a level 0 provider
 127  
          */
 128  
 
 129  0
         throw new UnsupportedCapabilityException();
 130  
     }
 131  
 
 132  
 }