Clover coverage report - Code Coverage for hivemind release 1.1-alpha-1
Coverage timestamp: Tue Jan 18 2005 07:55:08 EST
file stats: LOC: 166   Methods: 20
NCLOC: 111   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
ModuleImpl.java 100% 93.3% 90% 92.3%
coverage coverage
 1   
 // Copyright 2004, 2005 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.impl;
 16   
 
 17   
 import java.util.List;
 18   
 import java.util.Locale;
 19   
 import java.util.Map;
 20   
 
 21   
 import org.apache.hivemind.ClassResolver;
 22   
 import org.apache.hivemind.ErrorHandler;
 23   
 import org.apache.hivemind.Location;
 24   
 import org.apache.hivemind.Messages;
 25   
 import org.apache.hivemind.internal.Module;
 26   
 import org.apache.hivemind.internal.RegistryInfrastructure;
 27   
 import org.apache.hivemind.internal.ServiceModelFactory;
 28   
 import org.apache.hivemind.internal.ServicePoint;
 29   
 import org.apache.hivemind.schema.Translator;
 30   
 import org.apache.hivemind.util.IdUtils;
 31   
 import org.apache.hivemind.util.ToStringBuilder;
 32   
 
 33   
 /**
 34   
  * Implementation of {@link org.apache.hivemind.internal.Module}.
 35   
  * 
 36   
  * @author Howard Lewis Ship
 37   
  */
 38   
 public final class ModuleImpl extends BaseLocatable implements Module
 39   
 {
 40   
     private String _moduleId;
 41   
 
 42   
     private RegistryInfrastructure _registry;
 43   
 
 44   
     private ClassResolver _resolver;
 45   
 
 46   
     private Messages _messages;
 47   
 
 48  215
     public List getConfiguration(String extensionPointId)
 49   
     {
 50  215
         String qualifiedId = IdUtils.qualify(_moduleId, extensionPointId);
 51   
 
 52  215
         return _registry.getConfiguration(qualifiedId, this);
 53   
     }
 54   
 
 55  105
     public boolean canConfigurationBeMapped(String configurationId)
 56   
     {
 57  105
         String qualifiedId = IdUtils.qualify(_moduleId, configurationId);
 58   
 
 59  105
         return _registry.getConfigurationPoint(qualifiedId, this).canElementsBeMapped();
 60   
     }
 61   
 
 62  105
     public Map getMappedConfiguration(String configurationId)
 63   
     {
 64  105
         String qualifiedId = IdUtils.qualify(_moduleId, configurationId);
 65   
 
 66  105
         return _registry.getConfigurationPoint(qualifiedId, this).getMappedElements();
 67   
     }
 68   
 
 69  783
     public String getModuleId()
 70   
     {
 71  783
         return _moduleId;
 72   
     }
 73   
 
 74  0
     public boolean containsService(Class serviceInterface)
 75   
     {
 76  0
         return _registry.containsService(serviceInterface, this);
 77   
     }
 78   
 
 79  2088
     public Object getService(String serviceId, Class serviceInterface)
 80   
     {
 81  2088
         String qualifiedId = IdUtils.qualify(_moduleId, serviceId);
 82   
 
 83  2088
         return _registry.getService(qualifiedId, serviceInterface, this);
 84   
     }
 85   
 
 86  130
     public Object getService(Class serviceInterface)
 87   
     {
 88  130
         return _registry.getService(serviceInterface, this);
 89   
     }
 90   
 
 91  221
     public void setModuleId(String string)
 92   
     {
 93  221
         _moduleId = string;
 94   
     }
 95   
 
 96  220
     public void setRegistry(RegistryInfrastructure registry)
 97   
     {
 98  220
         _registry = registry;
 99   
     }
 100   
 
 101  219
     public void setClassResolver(ClassResolver resolver)
 102   
     {
 103  219
         _resolver = resolver;
 104   
     }
 105   
 
 106  7957
     public ClassResolver getClassResolver()
 107   
     {
 108  7957
         return _resolver;
 109   
     }
 110   
 
 111  46
     public synchronized Messages getMessages()
 112   
     {
 113  46
         if (_messages == null)
 114  8
             _messages = new MessagesImpl(getLocation().getResource(), _registry.getLocale());
 115   
 
 116  46
         return _messages;
 117   
     }
 118   
 
 119  5176
     public String expandSymbols(String input, Location location)
 120   
     {
 121  5176
         return _registry.expandSymbols(input, location);
 122   
     }
 123   
 
 124  4
     public String toString()
 125   
     {
 126  4
         ToStringBuilder builder = new ToStringBuilder(this);
 127   
 
 128  4
         builder.append("moduleId", _moduleId);
 129  4
         builder.append("classResolver", _resolver);
 130   
 
 131  4
         return builder.toString();
 132   
     }
 133   
 
 134  411
     public ServicePoint getServicePoint(String serviceId)
 135   
     {
 136  411
         String qualifiedId = IdUtils.qualify(_moduleId, serviceId);
 137   
 
 138  411
         return _registry.getServicePoint(qualifiedId, this);
 139   
     }
 140   
 
 141  1041
     public ServiceModelFactory getServiceModelFactory(String name)
 142   
     {
 143  1041
         return _registry.getServiceModelFactory(name);
 144   
     }
 145   
 
 146  5695
     public Translator getTranslator(String translator)
 147   
     {
 148  5695
         return _registry.getTranslator(translator);
 149   
     }
 150   
 
 151  3
     public Locale getLocale()
 152   
     {
 153  3
         return _registry.getLocale();
 154   
     }
 155   
 
 156  865
     public ErrorHandler getErrorHandler()
 157   
     {
 158  865
         return _registry.getErrorHander();
 159   
     }
 160   
 
 161  0
     public String valueForSymbol(String symbol)
 162   
     {
 163  0
         return _registry.valueForSymbol(symbol);
 164   
     }
 165   
 
 166   
 }