Package uk.co.real_logic.sbe.xml
Class ErrorHandler
java.lang.Object
uk.co.real_logic.sbe.xml.ErrorHandler
Class to hold error handling state while parsing an XML message schema.
-
Constructor Summary
ConstructorsConstructorDescriptionErrorHandler(PrintStream stream, ParserOptions options) Construct a newErrorHandlerthat outputs to a providedPrintStreamwhich overrides the value set inParserOptions.errorPrintStream().ErrorHandler(ParserOptions options) -
Method Summary
Modifier and TypeMethodDescriptionvoidCheck if the parser should exit.voidRecord a message signifying an error condition.intThe count of errors encountered.toString()voidRecord a message signifying a warning condition.intThe count of warnings encountered.
-
Constructor Details
-
ErrorHandler
Construct a newErrorHandlerthat outputs to a providedPrintStreamwhich overrides the value set inParserOptions.errorPrintStream().- Parameters:
stream- to which output should be sent.options- the parsing options.
-
ErrorHandler
- Parameters:
options- the parsing options.
-
-
Method Details
-
error
Record a message signifying an error condition.- Parameters:
msg- signifying an error.
-
warning
Record a message signifying a warning condition.- Parameters:
msg- signifying a warning.
-
checkIfShouldExit
public void checkIfShouldExit()Check if the parser should exit.- Throws:
IllegalStateException- if there are errors or warnings recorded.
-
errorCount
public int errorCount()The count of errors encountered.- Returns:
- the count of errors encountered.
-
warningCount
public int warningCount()The count of warnings encountered.- Returns:
- the count of warnings encountered.
-
toString
-