Package net.sf.basedb.util
Class XmlUtil2.Validator
java.lang.Object
net.sf.basedb.util.XmlUtil2.Validator
- All Implemented Interfaces:
EntityResolver
,ErrorHandler
- Enclosing class:
- XmlUtil2
private static class XmlUtil2.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
Fields Modifier and Type Field Description private URL
dtdFile
private String
parsedFile
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description 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
-
Field Details
-
parsedFile
-
dtdFile
-
-
Constructor Details
-
Validator
Create a new instance of this class.
-
-
Method Details
-
error
Errors thrown with a detailed error message.- Specified by:
error
in interfaceErrorHandler
- Throws:
SAXException
-
fatalError
Fatal errors thrown with a detailed error message.- Specified by:
fatalError
in interfaceErrorHandler
- Throws:
SAXException
-
warning
Ignore warnings- Specified by:
warning
in interfaceErrorHandler
- Throws:
SAXException
-
resolveEntity
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOExceptionThis 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 interfaceEntityResolver
- Throws:
SAXException
IOException
-