Xj3D 2.0 VRML/X3D Code API

org.web3d.x3d.jaxp
Class X3DErrorHandler

java.lang.Object
  extended by org.web3d.x3d.jaxp.X3DErrorHandler
All Implemented Interfaces:
org.xml.sax.ErrorHandler

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

Adapter implementation of the SAX ErrorHandler interface that communicates with our X3D ErrorReporter 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.4 $
Author:
Justin Couch

Constructor Summary
X3DErrorHandler()
          Create a new error handler that prints to the standard System.out.
 
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 setErrorReporter(ErrorReporter reporter)
          Register an error reporter with the manager so that any errors generated by the loading of script code can be reported in a nice, pretty fashion.
 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

X3DErrorHandler

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

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

setErrorReporter

public void setErrorReporter(ErrorReporter reporter)
Register an error reporter with the manager so that any errors generated by the loading of script code can be reported in a nice, pretty fashion. Setting a value of null will clear the currently set reporter. If one is already set, the new value replaces the old.

Parameters:
reporter - The instance to use or null

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium