org.stanwood.media.xml
Class SimpleErrorHandler

java.lang.Object
  extended by org.stanwood.media.xml.XMLErrorHandler
      extended by org.stanwood.media.xml.SimpleErrorHandler
All Implemented Interfaces:
org.xml.sax.ErrorHandler

public class SimpleErrorHandler
extends XMLErrorHandler

This class is used to handle parsing errors that occur when validating a xml file. It will usally display 5 lines either side of the error and give a messages with info about the problem that was found.


Constructor Summary
SimpleErrorHandler(java.io.File xmlFile)
          Used to construct the error handler
 
Method Summary
 void error(org.xml.sax.SAXParseException e)
          Used to print errors when they occur while validating the XML file
 void fatalError(org.xml.sax.SAXParseException e)
          Used to print fatal errors when they occur while validating the XML file
 void warning(org.xml.sax.SAXParseException e)
          Used to print warnings when they occur while validating the XML file
 
Methods inherited from class org.stanwood.media.xml.XMLErrorHandler
hasErrors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleErrorHandler

public SimpleErrorHandler(java.io.File xmlFile)
Used to construct the error handler

Parameters:
xmlFile - The file that is been parsed
Method Detail

warning

public void warning(org.xml.sax.SAXParseException e)
             throws org.xml.sax.SAXException
Used to print warnings when they occur while validating the XML file

Specified by:
warning in interface org.xml.sax.ErrorHandler
Overrides:
warning in class XMLErrorHandler
Parameters:
e - The exception that is been processed
Throws:
org.xml.sax.SAXException

error

public void error(org.xml.sax.SAXParseException e)
           throws org.xml.sax.SAXException
Used to print errors when they occur while validating the XML file

Specified by:
error in interface org.xml.sax.ErrorHandler
Overrides:
error in class XMLErrorHandler
Parameters:
e - The exception that is been processed
Throws:
org.xml.sax.SAXException

fatalError

public void fatalError(org.xml.sax.SAXParseException e)
                throws org.xml.sax.SAXException
Used to print fatal errors when they occur while validating the XML file

Specified by:
fatalError in interface org.xml.sax.ErrorHandler
Overrides:
fatalError in class XMLErrorHandler
Parameters:
e - The exception that is been processed
Throws:
org.xml.sax.SAXException