Clover coverage report -
Coverage timestamp: Do Okt 21 2004 12:21:23 CEST
file stats: LOC: 51   Methods: 3
NCLOC: 28   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ErrorReporter.java 75% 70% 100% 76,5%
coverage coverage
 1    package org.jconfig.error;
 2   
 3    import org.jconfig.utils.*;
 4    /**
 5    * This class will return the specified ErrorHandler.
 6    * You can define the ErrorHandler by setting the property<br/>
 7    * jconfig.errorhandler=org.jconfig.DefaultErrorHandler<br/>
 8    * You can also define your own ErrorHandler here. <br/>
 9    * If no ErrorHandler is defined then jConfig will use the so
 10    * called SimpleErrorHandler which will simply report
 11    * any error to the console.
 12    *
 13    * @author Andreas Mecky andreasmecky@yahoo.de
 14    * @author Terry Dye terrydye@yahoo.com
 15    */
 16    public class ErrorReporter {
 17   
 18    private static ErrorHandler eh = null;
 19    /**
 20    * This method will return the defined ErrorHandler. If
 21    * no ErrorHandler is defined it will return the SimpleErrorHandler.
 22    *
 23    * @return the ErrorHandler
 24    */
 25  14 public static ErrorHandler getErrorHandler() {
 26  14 if ( eh == null ) {
 27  1 String name = findHandler();
 28  1 if ( name == null ) {
 29  1 eh = getDefaultHandler();
 30    }
 31    else {
 32  0 try {
 33  0 eh = (ErrorHandler)Class.forName(name).newInstance();
 34    }
 35    catch (Exception e) {
 36  0 eh = getDefaultHandler();
 37    }
 38    }
 39    }
 40  14 return eh;
 41    }
 42   
 43  1 private static ErrorHandler getDefaultHandler() {
 44    //return new SimpleErrorHandler();
 45  1 return new NullDeviceErrorHandler();
 46    }
 47   
 48  1 private static String findHandler() {
 49  1 return ConfigurationUtils.getConfigProperty("jconfig.errorhandler");
 50    }
 51    }