Class MessageReporter
- java.lang.Object
-
- com.aquima.interactions.expressions.MessageReporter
-
- All Implemented Interfaces:
IParseListener
public class MessageReporter extends Object implements IParseListener
Parse listener wrapper used to collect error messages during a parse.- Since:
- 6.4
- Author:
- F. van der Meer
-
-
Constructor Summary
Constructors Constructor Description MessageReporter(IParseListener listener)
Constructs the message reported with the parse listener that should be wrapped.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getErrorCount()
This method returns the number of errors that were reported.String
getErrorSummary()
This method returns a string containing a summary of the reported errors.boolean
hasErrors()
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 Detail
-
MessageReporter
public MessageReporter(IParseListener listener)
Constructs the message reported with the parse listener that should be wrapped.- Parameters:
listener
- the parse listener that should be wrapped.
-
-
Method Detail
-
report
public void report(int startPosition, int endPosition, ErrorMessage message, Severity severity)
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
public String getErrorSummary()
This method returns a string containing a summary of the reported errors.- Returns:
- a string containing a summary of the reported errors.
-
-