Package org.xtce.toolkit
Class XTCESchemaErrorHandler
- java.lang.Object
-
- org.xtce.toolkit.XTCESchemaErrorHandler
-
- All Implemented Interfaces:
jakarta.xml.bind.ValidationEventHandler,ErrorHandler
public class XTCESchemaErrorHandler extends Object implements ErrorHandler, jakarta.xml.bind.ValidationEventHandler
A class for instantiating an error handler to catch the warnings and errors that are returned by the SAX XML parser.- Author:
- David Overeem
-
-
Constructor Summary
Constructors Constructor Description XTCESchemaErrorHandler()Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiderror(SAXParseException ex)Method to capture errors from the SAX parser.voidfatalError(IOException ex)Method to capture fatal errors from the SAX parser.voidfatalError(SAXException ex)Method to capture fatal errors from the SAX parser.voidfatalError(SAXParseException ex)Method to capture fatal errors from the SAX parser.longgetErrorCount()Retrieve the count of the errors that were logged by SAX during validation of the XTCE document.List<String>getMessages()Retrieve the list of messages collected by SAX during validation of the XTCE document.longgetWarningCount()Retrieve the count of the warnings that were logged by SAX during validation of the XTCE document.booleanhandleEvent(jakarta.xml.bind.ValidationEvent event)Method to capture schema validation events that occur during the JAXB unmarshal operation.voidwarning(SAXParseException ex)Method to capture warnings from the SAX parser.
-
-
-
Method Detail
-
error
public void error(SAXParseException ex)
Method to capture errors from the SAX parser.- Specified by:
errorin interfaceErrorHandler- Parameters:
ex- Exception received from SAX to interrogate.
-
warning
public void warning(SAXParseException ex)
Method to capture warnings from the SAX parser.- Specified by:
warningin interfaceErrorHandler- Parameters:
ex- Exception received from SAX to interrogate.
-
fatalError
public void fatalError(SAXParseException ex)
Method to capture fatal errors from the SAX parser.- Specified by:
fatalErrorin interfaceErrorHandler- Parameters:
ex- Exception received from SAX to interrogate.
-
fatalError
public void fatalError(SAXException ex)
Method to capture fatal errors from the SAX parser.- Parameters:
ex- Exception received from SAX to interrogate.
-
fatalError
public void fatalError(IOException ex)
Method to capture fatal errors from the SAX parser.- Parameters:
ex- Exception received from file reading to interrogate.
-
handleEvent
public boolean handleEvent(jakarta.xml.bind.ValidationEvent event)
Method to capture schema validation events that occur during the JAXB unmarshal operation.- Specified by:
handleEventin interfacejakarta.xml.bind.ValidationEventHandler- Parameters:
event- ValidationEvent containing the message of interest.- Returns:
- true unless the event is null, then it is false.
-
getMessages
public List<String> getMessages()
Retrieve the list of messages collected by SAX during validation of the XTCE document.- Returns:
- List of Strings that were collected from the parser.
-
getWarningCount
public long getWarningCount()
Retrieve the count of the warnings that were logged by SAX during validation of the XTCE document.- Returns:
- long containing the count.
-
getErrorCount
public long getErrorCount()
Retrieve the count of the errors that were logged by SAX during validation of the XTCE document.- Returns:
- long containing the count.
-
-