Clover coverage report - Code Coverage for hivemind release 1.0-rc-2
Coverage timestamp: Sat Sep 11 2004 09:09:48 EDT
file stats: LOC: 57   Methods: 2
NCLOC: 20   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
IdUtils.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.util;
 16   
 
 17   
 import org.apache.hivemind.HiveMind;
 18   
 
 19   
 /**
 20   
  * A collection of utilities for handling qualified and unqualified ids.
 21   
  *
 22   
  * @author Howard Lewis Ship
 23   
  */
 24   
 public class IdUtils
 25   
 {
 26   
 
 27   
     /**
 28   
      * Returns a fully qualfied id.  If the id contains a '.', then it
 29   
      * is returned unchanged.  Otherwise, the module's id is prefixed (with a 
 30   
      * seperator '.') and returned;
 31   
      */
 32  2655
     public static String qualify(String moduleId, String id)
 33   
     {
 34  2655
         if (id.indexOf('.') > 0)
 35  1752
             return id;
 36   
 
 37  903
         return moduleId + "." + id;
 38   
     }
 39   
 
 40   
     /**
 41   
      * Qualifies a list of interceptor service ids provided for an interceptor
 42   
      * contribution.  The special value "*" is not qualified.
 43   
      */
 44  65
     public static String qualifyList(String sourceModuleId, String list)
 45   
     {
 46  65
         if (HiveMind.isBlank(list) || list.equals("*"))
 47  61
             return list;
 48   
 
 49  4
         String[] items = StringUtils.split(list);
 50   
 
 51  4
         for (int i = 0; i < items.length; i++)
 52  7
             items[i] = qualify(sourceModuleId, items[i]);
 53   
 
 54  4
         return StringUtils.join(items, ',');
 55   
     }
 56   
 }
 57