Class MessageReporter
java.lang.Object
com.aquima.interactions.expressions.MessageReporter
- All Implemented Interfaces:
IParseListener
Parse listener wrapper used to collect error messages during a parse.
- Since:
- 6.4
- Author:
- F. van der Meer
-
Constructor Summary
ConstructorsConstructorDescriptionMessageReporter
(IParseListener listener) Constructs the message reported with the parse listener that should be wrapped. -
Method Summary
Modifier and TypeMethodDescriptionint
This method returns the number of errors that were reported.This method returns a string containing a summary of the reported errors.boolean
This method returns a boolean indicating if any errors have been reported.void
report
(int startPosition, int endPosition, ErrorMessage message, Severity severity) This method is invoked by the parser when a problem is detected during the parse of an expression.
-
Constructor Details
-
MessageReporter
Constructs the message reported with the parse listener that should be wrapped.- Parameters:
listener
- the parse listener that should be wrapped.
-
-
Method Details
-
report
Description copied from interface:IParseListener
This method is invoked by the parser when a problem is detected during the parse of an expression.- Specified by:
report
in interfaceIParseListener
- Parameters:
startPosition
- The start position in the expression where the warning was detected.endPosition
- The end position in the expression of the part that generated the warning.message
- Object containing the details of the warning that was detected.severity
- The severity of the problem that was detected.
-
getErrorCount
public int getErrorCount()This method returns the number of errors that were reported.- Returns:
- the number of errors that were reported.
-
hasErrors
public boolean hasErrors()This method returns a boolean indicating if any errors have been reported.- Returns:
- boolean indicating if any errors have been reported.
-
getErrorSummary
This method returns a string containing a summary of the reported errors.- Returns:
- a string containing a summary of the reported errors.
-