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: 123   Methods: 15
NCLOC: 83   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
ParseMessages.java - 62.5% 60% 61.3%
coverage 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.Collection;
 18   
 
 19   
 import org.apache.hivemind.Location;
 20   
 import org.apache.hivemind.Resource;
 21   
 import org.apache.hivemind.impl.MessageFormatter;
 22   
 import org.apache.hivemind.schema.ElementModel;
 23   
 
 24   
 /**
 25   
  * Messages for the parse package.
 26   
  *
 27   
  * @author Howard Lewis Ship
 28   
  */
 29   
 final class ParseMessages
 30   
 {
 31   
     private static final MessageFormatter _formatter =
 32   
         new MessageFormatter(ParseMessages.class, "ParseStrings");
 33   
 
 34  1
     public static String dupeAttributeMapping(
 35   
         AttributeMappingDescriptor newDescriptor,
 36   
         AttributeMappingDescriptor existingDescriptor)
 37   
     {
 38  1
         return _formatter.format(
 39   
             "dupe-attribute-mapping",
 40   
             newDescriptor.getAttributeName(),
 41   
             existingDescriptor.getLocation());
 42   
     }
 43   
 
 44  1
     public static String extraMappings(Collection extraNames, ElementModel model)
 45   
     {
 46  1
         return _formatter.format("extra-mappings", extraNames, model.getElementName());
 47   
     }
 48   
 
 49  1
     public static String unableToResolveSchema(String schemaId)
 50   
     {
 51  1
         return _formatter.format("unable-to-resolve-schema", schemaId);
 52   
     }
 53   
 
 54  0
     public static String notModule(String elementName, Location location)
 55   
     {
 56  0
         return _formatter.format("not-module", elementName, location);
 57   
     }
 58   
 
 59  1
     public static String requiredAttribute(String name, String path, Location location)
 60   
     {
 61  1
         return _formatter.format("required-attribute", name, path, location);
 62   
     }
 63   
 
 64  1
     public static String unknownAttribute(String name, String path)
 65   
     {
 66  1
         return _formatter.format("unknown-attribute", name, path);
 67   
     }
 68   
 
 69  0
     public static String booleanAttribute(String value, String name, String path)
 70   
     {
 71  0
         return _formatter.format("boolean-attribute", new Object[] { value, name, path });
 72   
     }
 73   
 
 74  0
     public static String invalidAttributeValue(String value, String name, String path)
 75   
     {
 76  0
         return _formatter.format("invalid-attribute-value", new Object[] { value, name, path });
 77   
 
 78   
     }
 79   
 
 80  0
     public static String invalidNumericValue(String value, String name, String path)
 81   
     {
 82  0
         return _formatter.format("invalid-numeric-value", new Object[] { value, name, path });
 83   
     }
 84   
 
 85  0
     public static String unableToInitialize(Throwable cause)
 86   
     {
 87  0
         return _formatter.format("unable-to-initialize", cause);
 88   
     }
 89   
 
 90  1
     public static String badRuleClass(String className, Location location, Throwable cause)
 91   
     {
 92  1
         return _formatter.format("bad-rule-class", className, location, cause);
 93   
     }
 94   
 
 95  3
     public static String errorReadingDescriptor(Resource resource, Throwable cause)
 96   
     {
 97  3
         return _formatter.format("error-reading-descriptor", resource, cause);
 98   
     }
 99   
 
 100  0
     public static String missingResource(Resource resource)
 101   
     {
 102  0
         return _formatter.format("missing-resource", resource);
 103   
     }
 104   
 
 105  1
     public static String unexpectedElement(String elementName, String elementPath)
 106   
     {
 107  1
         return _formatter.format("unexpected-element", elementName, elementPath);
 108   
     }
 109   
 
 110  3
     public static String invalidAttributeFormat(
 111   
         String attributeName,
 112   
         String value,
 113   
         String elementPath,
 114   
         String formatKey)
 115   
     {
 116  3
         String inputValueFormat = _formatter.getMessage(formatKey);
 117   
 
 118  3
         return _formatter.format(
 119   
             "invalid-attribute-format",
 120   
             new Object[] { attributeName, value, elementPath, inputValueFormat });
 121   
     }
 122   
 }
 123