From 035ea4f59287d8c3f3ccd6bae5e6a9306162a0df Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@d688527b-c9ab-4aba-bd8d-4036d912da1d> Date: Mon, 24 Jan 2005 11:20:53 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'Build-SPSS-1_2_0_D04'. git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/tags/Build-SPSS-1_2_0_D04@254 d688527b-c9ab-4aba-bd8d-4036d912da1d --- .../gv/egovernment/moa/util/MOAErrorHandler.java | 85 ---------------------- 1 file changed, 85 deletions(-) delete mode 100644 common/src/at/gv/egovernment/moa/util/MOAErrorHandler.java (limited to 'common/src/at/gv/egovernment/moa/util/MOAErrorHandler.java') diff --git a/common/src/at/gv/egovernment/moa/util/MOAErrorHandler.java b/common/src/at/gv/egovernment/moa/util/MOAErrorHandler.java deleted file mode 100644 index 1f7757c8f..000000000 --- a/common/src/at/gv/egovernment/moa/util/MOAErrorHandler.java +++ /dev/null @@ -1,85 +0,0 @@ -package at.gv.egovernment.moa.util; - -import org.apache.xml.utils.DefaultErrorHandler; -import org.xml.sax.SAXException; -import org.xml.sax.SAXParseException; - -import at.gv.egovernment.moa.logging.LogMsg; -import at.gv.egovernment.moa.logging.Logger; - -/** - * An ErrorHandler that logs a message and throws a - * SAXException upon error and fatal - * parsing errors. - * - * @author Patrick Peck - * @author Sven Aigner - */ -public class MOAErrorHandler extends DefaultErrorHandler { - - /** - * Logs a warning message. - * - * @see org.xml.sax.ErrorHandler#warning(SAXParseException) - */ - public void warning(SAXParseException exception) throws SAXException { - warn("parser.00", messageParams(exception), null); - } - - /** - * Logs a warning and rethrows the exception. - * - * @see org.xml.sax.ErrorHandler#error(SAXParseException) - */ - public void error(SAXParseException exception) throws SAXException { - warn("parser.01", messageParams(exception), null); - throw exception; - } - - /** - * Logs a warning and rethrows the exception. - * - * @see org.xml.sax.ErrorHandler#fatalError(SAXParseException) - */ - public void fatalError(SAXParseException exception) throws SAXException { - warn("parser.02", messageParams(exception), null); - throw exception; - } - - /** - * Log a warning message. - * - * @param messageId The message ID to log. - * @param parameters Additional message parameters. - * @param t The Throwable to log; usually the cause of this - * warning. - */ - private static void warn( - String messageId, - Object[] parameters, - Throwable t) { - - MessageProvider msg = MessageProvider.getInstance(); - Logger.warn(new LogMsg(msg.getMessage(messageId, parameters)), t); - } - - /** - * Put the system id, line and column number information from the exception - * into an Object array, to provide it as a - * MessageFormat parameter. - * - * @param e The SAXParseException containing the - * source system id and line/column numbers. - * @return An array containing the system id (a String) as well - * as line/column numbers (2 Integer objects) from the - * SAXParseException. - */ - private static Object[] messageParams(SAXParseException e) { - return new Object[] { - e.getMessage(), - e.getSystemId(), - new Integer(e.getLineNumber()), - new Integer(e.getColumnNumber())}; - } - -} \ No newline at end of file -- cgit v1.2.3