j3d.org Code

org.j3d.util
Class SAXErrorHandler

java.lang.Object
  extended by org.j3d.util.SAXErrorHandler
All Implemented Interfaces:
org.xml.sax.ErrorHandler

public class SAXErrorHandler
extends java.lang.Object
implements org.xml.sax.ErrorHandler

Common convenience implementation of the SAX ErrorHandler interface.

Provides marginally better error handling that prints to the nominated output stream. If no stream is provided, it prints to stdout.

Version:
$Revision: 1.2 $
Author:
Justin Couch

Constructor Summary
SAXErrorHandler()
          Create a new error handler that prints to the standard System.out.
SAXErrorHandler(java.io.PrintStream out)
          Create an error handler that uses the given output stream for writing debugging messages.
 
Method Summary
 void error(org.xml.sax.SAXParseException spe)
          Process a non-fatal error exception.
 void fatalError(org.xml.sax.SAXParseException spe)
          Process a non-fatal error exception.
 void warning(org.xml.sax.SAXParseException spe)
          Process a warning exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAXErrorHandler

public SAXErrorHandler()
Create a new error handler that prints to the standard System.out.


SAXErrorHandler

public SAXErrorHandler(java.io.PrintStream out)
Create an error handler that uses the given output stream for writing debugging messages.

Method Detail

warning

public void warning(org.xml.sax.SAXParseException spe)
             throws org.xml.sax.SAXException
Process a warning exception. Just prints the message out

Specified by:
warning in interface org.xml.sax.ErrorHandler
Parameters:
spe - The exception to be processed
Throws:
org.xml.sax.SAXException - Never thrown

error

public void error(org.xml.sax.SAXParseException spe)
           throws org.xml.sax.SAXException
Process a non-fatal error exception. Prints the message out and re-throws the exception.

Specified by:
error in interface org.xml.sax.ErrorHandler
Parameters:
spe - The exception to be processed
Throws:
org.xml.sax.SAXException - A wrapped version of the original exception

fatalError

public void fatalError(org.xml.sax.SAXParseException spe)
                throws org.xml.sax.SAXException
Process a non-fatal error exception. Prints the message out and re-throws the exception.

Specified by:
fatalError in interface org.xml.sax.ErrorHandler
Parameters:
spe - The exception to be processed
Throws:
org.xml.sax.SAXException - A wrapped version of the original exception

j3d.org Code

Latest Info from http://code.j3d.org/
Copyright © 2001 - j3d.org