Class XmlErrorHandler
java.lang.Object
gov.niem.tools.api.validation.xml.XmlErrorHandler
- All Implemented Interfaces:
ErrorHandler
Custom error handler to catch and log SAX exceptions. This overrides the default
exception handler which would stop validation on the first exception encountered.
-
Constructor Summary
ConstructorsConstructorDescriptionXmlErrorHandler
(File[] files, XmlNodeMap nodeMapTemplate, Test test) Creates the custom XML error handler. -
Method Summary
Modifier and TypeMethodDescriptionendTest()
Stop the test run clock and summarize the test status in the comments.void
error
(SAXParseException exception) void
fatalError
(SAXParseException exception) getTest()
void
warning
(SAXParseException exception)
-
Constructor Details
-
XmlErrorHandler
Creates the custom XML error handler.For each given file, builds the XML or XSD node map, mapping names to line numbers.
- Parameters:
files
- - XML files to use to look up component names based on exception line numbersnodeMapTemplate
- - Empty XML or XSD node maptest
- - The test object in which to record information about validation errors- Throws:
IOException
-
-
Method Details
-
getExceptions
-
endTest
Stop the test run clock and summarize the test status in the comments. -
warning
- Specified by:
warning
in interfaceErrorHandler
- Throws:
SAXException
-
error
- Specified by:
error
in interfaceErrorHandler
- Throws:
SAXException
-
fatalError
- Specified by:
fatalError
in interfaceErrorHandler
- Throws:
SAXException
-
getTest
-