FreeHEP API
Version current

org.freehep.xml.util
Class SAXErrorHandler

java.lang.Object
  extended byorg.freehep.xml.util.SAXErrorHandler
All Implemented Interfaces:
ErrorHandler

public class SAXErrorHandler
extends Object
implements ErrorHandler

A simple SAXErrorHandler. Reports errors to System.err and keeps track of the most severe error. Can be configured to throw exceptions when errors more severe than a certain LEVEL are encountered

Version:
$Id: SAXErrorHandler.java,v 1.1 2001/02/16 00:46:24 tonyj Exp $
Author:
tonyj
Source Code:
SAXErrorHandler.java

Field Summary
static int LEVEL_ERROR
           
static int LEVEL_FATAL
           
static int LEVEL_SUCCESS
           
static int LEVEL_WARNING
           
 
Constructor Summary
SAXErrorHandler()
          Create a SAXErrorHandler which will throw exceptions for all errors (but not warnings)
SAXErrorHandler(int minLevelForException)
          Create a SAXErrorHandler
 
Method Summary
 void error(SAXParseException exception)
           
 void fatalError(SAXParseException exception)
           
 int getErrorLevel()
          Get the level of the most severe error.
 void warning(SAXParseException exception)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEVEL_SUCCESS

public static final int LEVEL_SUCCESS
See Also:
Constant Field Values

LEVEL_WARNING

public static final int LEVEL_WARNING
See Also:
Constant Field Values

LEVEL_ERROR

public static final int LEVEL_ERROR
See Also:
Constant Field Values

LEVEL_FATAL

public static final int LEVEL_FATAL
See Also:
Constant Field Values
Constructor Detail

SAXErrorHandler

public SAXErrorHandler()
Create a SAXErrorHandler which will throw exceptions for all errors (but not warnings)


SAXErrorHandler

public SAXErrorHandler(int minLevelForException)
Create a SAXErrorHandler

Parameters:
minLevelForException - The minimum error level for which exceptions will be thrown
Method Detail

warning

public void warning(SAXParseException exception)
             throws SAXException
Specified by:
warning in interface ErrorHandler
Throws:
SAXException

error

public void error(SAXParseException exception)
           throws SAXException
Specified by:
error in interface ErrorHandler
Throws:
SAXException

fatalError

public void fatalError(SAXParseException exception)
                throws SAXException
Specified by:
fatalError in interface ErrorHandler
Throws:
SAXException

getErrorLevel

public int getErrorLevel()
Get the level of the most severe error.

Returns:
one of LEVEL_SUCCESS, LEVEL_WARNING, LEVEL_ERROR, LEVEL_FATAL

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.