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
    Constructs the message reported with the parse listener that should be wrapped.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • 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 Details

    • 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 interface IParseListener
      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.