Clover coverage report - Code Coverage for hivemind release 1.0-beta-2
Coverage timestamp: Sun Aug 1 2004 14:03:45 EDT
file stats: LOC: 83   Methods: 5
NCLOC: 37   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
AbstractServiceDescriptor.java 100% 100% 100% 100%
coverage
 1   
 //  Copyright 2004 The Apache Software Foundation
 2   
 //
 3   
 // Licensed under the Apache License, Version 2.0 (the "License");
 4   
 // you may not use this file except in compliance with the License.
 5   
 // You may obtain a copy of the License at
 6   
 //
 7   
 //     http://www.apache.org/licenses/LICENSE-2.0
 8   
 //
 9   
 // Unless required by applicable law or agreed to in writing, software
 10   
 // distributed under the License is distributed on an "AS IS" BASIS,
 11   
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12   
 // See the License for the specific language governing permissions and
 13   
 // limitations under the License.
 14   
 
 15   
 package org.apache.hivemind.parse;
 16   
 
 17   
 import java.util.ArrayList;
 18   
 import java.util.List;
 19   
 
 20   
 import org.apache.hivemind.impl.BaseLocatable;
 21   
 import org.apache.hivemind.util.ToStringBuilder;
 22   
 
 23   
 /**
 24   
  * Base class for {@link org.apache.hivemind.parse.ServicePointDescriptor} and 
 25   
  * {@link org.apache.hivemind.parse.ImplementationDescriptor}.
 26   
  * 
 27   
  *
 28   
  * @author Howard Lewis Ship
 29   
  */
 30   
 public abstract class AbstractServiceDescriptor extends BaseLocatable
 31   
 {
 32   
     private InstanceBuilder _instanceBuilder;
 33   
     private List _interceptors;
 34   
 
 35  2
     public String toString()
 36   
     {
 37  2
         ToStringBuilder builder = new ToStringBuilder(this);
 38   
 
 39  2
         extendDescription(builder);
 40   
 
 41  2
         builder.append("instanceBuilder", _instanceBuilder);
 42  2
         builder.append("interceptors", _interceptors);
 43   
 
 44  2
         return builder.toString();
 45   
     }
 46   
 
 47   
     /**
 48   
      * Implemented in subclasses to provide details about the instance.
 49   
      */
 50   
     protected abstract void extendDescription(ToStringBuilder builder);
 51   
 
 52  1321
     public InstanceBuilder getInstanceBuilder()
 53   
     {
 54  1321
         return _instanceBuilder;
 55   
     }
 56   
 
 57   
     /**
 58   
      * A service extension may contribute one instance builder.
 59   
      */
 60  1327
     public void setInstanceBuilder(InstanceBuilder descriptor)
 61   
     {
 62  1327
         _instanceBuilder = descriptor;
 63   
     }
 64   
 
 65  45
     public void addInterceptor(InterceptorDescriptor interceptor)
 66   
     {
 67  45
         if (_interceptors == null)
 68  34
             _interceptors = new ArrayList();
 69   
 
 70  45
         _interceptors.add(interceptor);
 71   
     }
 72   
 
 73   
     /**
 74   
      * Returns a list of {@link InterceptorDescriptor}.  May
 75   
      * return null.  The caller should not modify the returned list.
 76   
      */
 77  1322
     public List getInterceptors()
 78   
     {
 79  1322
         return _interceptors;
 80   
     }
 81   
 
 82   
 }
 83