2.17.2: 2011-06-17

net.sf.basedb.util
Class XMLUtil.Validator

java.lang.Object
  extended by net.sf.basedb.util.XMLUtil.Validator
All Implemented Interfaces:
EntityResolver, ErrorHandler
Enclosing class:
XMLUtil

private static class XMLUtil.Validator
extends Object
implements ErrorHandler, EntityResolver

This class is used to handle callbacks from the XML parser. We need this for throwing better error messages and to find the DTD.


Field Summary
private  URL dtdFile
           
private  String parsedFile
           
 
Constructor Summary
private XMLUtil.Validator(String parsedFile, URL dtdFile)
          Create a new instance of this class.
 
Method Summary
 void error(SAXParseException exception)
          Errors thrown with a detailed error message.
 void fatalError(SAXParseException exception)
          Fatal errors thrown with a detailed error message.
 InputSource resolveEntity(String publicId, String systemId)
          This method is called when the parser wants a reference to the DTD file.
 void warning(SAXParseException exception)
          Ignore warnings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parsedFile

private final String parsedFile

dtdFile

private final URL dtdFile
Constructor Detail

XMLUtil.Validator

private XMLUtil.Validator(String parsedFile,
                          URL dtdFile)
Create a new instance of this class.

Method Detail

error

public void error(SAXParseException exception)
           throws SAXException
Errors thrown with a detailed error message.

Specified by:
error in interface ErrorHandler
Throws:
SAXException

fatalError

public void fatalError(SAXParseException exception)
                throws SAXException
Fatal errors thrown with a detailed error message.

Specified by:
fatalError in interface ErrorHandler
Throws:
SAXException

warning

public void warning(SAXParseException exception)
             throws SAXException
Ignore warnings

Specified by:
warning in interface ErrorHandler
Throws:
SAXException

resolveEntity

public InputSource resolveEntity(String publicId,
                                 String systemId)
                          throws SAXException,
                                 IOException
This method is called when the parser wants a reference to the DTD file. If the DTD cannot be loaded null is returned.

Specified by:
resolveEntity in interface EntityResolver
Throws:
SAXException
IOException

2.17.2: 2011-06-17