autohit.creator.compiler
Class XmlParseErrorHandler

java.lang.Object
  extended byautohit.creator.compiler.XmlParseErrorHandler
All Implemented Interfaces:
org.xml.sax.ErrorHandler

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

Parse Error Handler. It will just collect the errors in a list for use later. WARNING!!! An instance of this must be registered with the parser before EACH compile.

Version:
1.1 Version History EPG - Initial - 10Apr03
Author:
Erich P. Gatejen

Field Summary
 XmlCompiler xc
          Keep a reference to the Xml compiler, so we can get to the logging funktions.
 
Constructor Summary
XmlParseErrorHandler()
          Default constructor.
XmlParseErrorHandler(XmlCompiler xcp)
          Constructor.
 
Method Summary
 void emitDebug(java.lang.String text)
          Add an warning to the error log.
 void emitError(java.lang.String text)
          Add an error to the error log.
 void emitWarning(java.lang.String text)
          Add an debug notice to the error log.
 void error(org.xml.sax.SAXParseException e)
          Receive an error from the compiler.
 void fatalError(org.xml.sax.SAXParseException e)
          Receive a fatal error from the compiler.
 void warning(org.xml.sax.SAXParseException e)
          Receive a warning from the compiler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xc

public XmlCompiler xc
Keep a reference to the Xml compiler, so we can get to the logging funktions.

Constructor Detail

XmlParseErrorHandler

public XmlParseErrorHandler(XmlCompiler xcp)
                     throws java.lang.Exception
Constructor. Takes a reference to the XmlCompiler so we can get to the logging functions. You can use the default constructor, but you better set xc or you will get undefined results.

Parameters:
xcp - A valid XmlCompiler
See Also:
XmlCompiler

XmlParseErrorHandler

public XmlParseErrorHandler()
                     throws java.lang.Exception
Default constructor.

Method Detail

emitError

public void emitError(java.lang.String text)
Add an error to the error log.


emitWarning

public void emitWarning(java.lang.String text)
Add an debug notice to the error log.


emitDebug

public void emitDebug(java.lang.String text)
Add an warning to the error log.


error

public void error(org.xml.sax.SAXParseException e)
           throws org.xml.sax.SAXException
Receive an error from the compiler. Do not call this method directly.

Specified by:
error in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException - Send back to document builder

fatalError

public void fatalError(org.xml.sax.SAXParseException e)
                throws org.xml.sax.SAXException
Receive a fatal error from the compiler. Do not call this method directly.

Specified by:
fatalError in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException - Send back to document builder

warning

public void warning(org.xml.sax.SAXParseException e)
             throws org.xml.sax.SAXException
Receive a warning from the compiler. Do not call this method directly.

Specified by:
warning in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException - Send back to document builder


Test.