com.irisel.util
Class ErrorStorer

java.lang.Object
  extended by com.irisel.util.ErrorStorer
All Implemented Interfaces:
org.xml.sax.ErrorHandler

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

The ErrorStorer maps Nodes to errors.It receives a reference to the ErrorTreeFactory in the Constructor.When error is called, it asks the ErrorTreeFactory for the current node, and uses this as the "key" of a Hashtable, with the error as a value.The error value is wrapped up nicely in an ParseError object.It is used in the XML Tutorial to illustrate how to implement the ErrorListener to provide error storage for later reference.


Constructor Summary
ErrorStorer(org.apache.xerces.parsers.DOMParser parser)
          Constructor
 
Method Summary
 void error(org.xml.sax.SAXParseException ex)
           
 void fatalError(org.xml.sax.SAXParseException ex)
           
 java.lang.Object getError(org.w3c.dom.Node node)
          The ParseError object for the node key is returned.If the node doesn't have errors, null is returned.
 java.util.Hashtable getErrorNodes()
          The client is is allowed to get a reference to the Hashtable, and so could corrupt it, or add to it...
 void resetErrors()
          Reset the error storage.
 void warning(org.xml.sax.SAXParseException ex)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ErrorStorer

public ErrorStorer(org.apache.xerces.parsers.DOMParser parser)
Constructor

Method Detail

getErrorNodes

public java.util.Hashtable getErrorNodes()
The client is is allowed to get a reference to the Hashtable, and so could corrupt it, or add to it...


getError

public java.lang.Object getError(org.w3c.dom.Node node)
The ParseError object for the node key is returned.If the node doesn't have errors, null is returned.


resetErrors

public void resetErrors()
Reset the error storage.


warning

public void warning(org.xml.sax.SAXParseException ex)
Specified by:
warning in interface org.xml.sax.ErrorHandler

error

public void error(org.xml.sax.SAXParseException ex)
Specified by:
error in interface org.xml.sax.ErrorHandler

fatalError

public void fatalError(org.xml.sax.SAXParseException ex)
                throws org.xml.sax.SAXException
Specified by:
fatalError in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException