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: 186   Methods: 23
NCLOC: 140   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
RulesMessages.java - 87% 87% 87%
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.schema.rules;
 16   
 
 17   
 import org.apache.hivemind.Element;
 18   
 import org.apache.hivemind.HiveMind;
 19   
 import org.apache.hivemind.Location;
 20   
 import org.apache.hivemind.impl.MessageFormatter;
 21   
 import org.apache.hivemind.internal.Module;
 22   
 import org.apache.hivemind.schema.SchemaProcessor;
 23   
 
 24   
 /**
 25   
  * Messages related to the rules package.
 26   
  *
 27   
  * @author Howard Lewis Ship
 28   
  */
 29   
 final class RulesMessages
 30   
 {
 31   
 
 32   
     private static final MessageFormatter _formatter =
 33   
         new MessageFormatter(RulesMessages.class, "RulesStrings");
 34   
 
 35  0
     public static String unableToSetElementProperty(
 36   
         String propertyName,
 37   
         Object target,
 38   
         SchemaProcessor processor,
 39   
         Element element,
 40   
         Throwable cause)
 41   
     {
 42  0
         return _formatter.format(
 43   
             "unable-to-set-element-property",
 44   
             new Object[] {
 45   
                 propertyName,
 46   
                 target,
 47   
                 processor.getElementPath(),
 48   
                 HiveMind.getLocationString(element),
 49   
                 cause });
 50   
     }
 51   
 
 52  0
     public static String unableToSetProperty(String propertyName, Object target, Throwable cause)
 53   
     {
 54  0
         return _formatter.format("unable-to-set-property", propertyName, target, cause);
 55   
     }
 56   
 
 57  1
     public static String invalidBooleanValue(String inputValue)
 58   
     {
 59  1
         return _formatter.format("invalid-boolean-value", inputValue);
 60   
     }
 61   
 
 62  0
     public static String errorCreatingObject(String className, Location location, Throwable cause)
 63   
     {
 64  0
         return _formatter.format("error-creating-object", className, location, cause);
 65   
     }
 66   
 
 67  1
     public static String invalidDoubleValue(String inputValue)
 68   
     {
 69  1
         return _formatter.format("invalid-double-value", inputValue);
 70   
     }
 71   
 
 72  2
     public static String minDoubleValue(String inputValue, double minValue)
 73   
     {
 74  2
         return _formatter.format("min-double-value", inputValue, new Double(minValue));
 75   
     }
 76   
 
 77  2
     public static String maxDoubleValue(String inputValue, double maxValue)
 78   
     {
 79  2
         return _formatter.format("max-double-value", inputValue, new Double(maxValue));
 80   
     }
 81   
 
 82  1
     public static String enumNotRecognized(String inputValue)
 83   
     {
 84  1
         return _formatter.format("enum-not-recognized", inputValue);
 85   
     }
 86   
 
 87  1
     public static String enumError(Class enumClass, String fieldName, Throwable cause)
 88   
     {
 89  1
         return _formatter.format("enum-error", enumClass.getName(), fieldName, cause);
 90   
     }
 91   
 
 92  2
     public static String invalidIntValue(String inputValue)
 93   
     {
 94  2
         return _formatter.format("invalid-int-value", inputValue);
 95   
     }
 96   
 
 97  3
     public static String minIntValue(String inputValue, int minValue)
 98   
     {
 99  3
         return _formatter.format("min-int-value", inputValue, new Integer(minValue));
 100   
     }
 101   
 
 102  3
     public static String maxIntValue(String inputValue, int maxValue)
 103   
     {
 104  3
         return _formatter.format("max-int-value", inputValue, new Integer(maxValue));
 105   
     }
 106   
 
 107  1
     public static String errorInvokingMethod(
 108   
         String methodName,
 109   
         Object parent,
 110   
         Location location,
 111   
         Throwable cause)
 112   
     {
 113  1
         return _formatter.format(
 114   
             "error-invoking-method",
 115   
             new Object[] { methodName, parent, location, cause });
 116   
     }
 117   
 
 118  1
     public static String invalidLongValue(String inputValue)
 119   
     {
 120  1
         return _formatter.format("invalid-long-value", inputValue);
 121   
     }
 122   
 
 123  2
     public static String minLongValue(String inputValue, long minValue)
 124   
     {
 125  2
         return _formatter.format("min-long-value", inputValue, new Long(minValue));
 126   
     }
 127   
 
 128  2
     public static String maxLongValue(String inputValue, long maxValue)
 129   
     {
 130  2
         return _formatter.format("max-long-value", inputValue, new Long(maxValue));
 131   
     }
 132   
 
 133  5
     public static String readAttributeFailure(
 134   
         String attributeName,
 135   
         Element element,
 136   
         SchemaProcessor processor,
 137   
         Throwable cause)
 138   
     {
 139  5
         return _formatter.format(
 140   
             "read-attribute-failure",
 141   
             new Object[] { attributeName, processor.getElementPath(), cause });
 142   
     }
 143   
 
 144  2
     public static String readContentFailure(
 145   
         SchemaProcessor processor,
 146   
         Element element,
 147   
         Throwable cause)
 148   
     {
 149  2
         return _formatter.format("read-content-failure", processor.getElementPath(), cause);
 150   
     }
 151   
 
 152  1
     public static String resourceLocalizationError(String inputValue, Module contributingModule)
 153   
     {
 154  1
         return _formatter.format(
 155   
             "resource-localization-error",
 156   
             inputValue,
 157   
             contributingModule.getModuleId());
 158   
     }
 159   
 
 160  1
     public static String invalidInitializer(String initializer)
 161   
     {
 162  1
         return _formatter.format("invalid-initializer", initializer);
 163   
     }
 164   
 
 165  1
     public static String noPropertyEditor(Class propertyType)
 166   
     {
 167  1
         return _formatter.format("no-property-editor", propertyType.getName());
 168   
     }
 169   
 
 170  1
     public static String smartTranslatorError(
 171   
         String inputValue,
 172   
         Class propertyType,
 173   
         Throwable cause)
 174   
     {
 175  1
         return _formatter.format(
 176   
             "smart-translator-error",
 177   
             inputValue,
 178   
             propertyType.getName(),
 179   
             cause);
 180   
     }
 181   
 
 182  1
     public static String unableToInstantiateInstanceOfClass(Class clazz, Throwable cause)
 183   
     {
 184  1
         return _formatter.format("unable-to-instantiate-instance-of-class", clazz.getName(), cause);
 185   
     }
 186   
 }