Class PrintSaxMessager

java.lang.Object
uk.ac.starlink.ttools.votlint.PrintSaxMessager
All Implemented Interfaces:
SaxMessager

public class PrintSaxMessager extends Object implements SaxMessager
SaxMessager implementation that writes messages to a given print stream. An effort is made not to output the same message millions of times. The maximum number of times the same message will be output is controlled by the maxRepeat parameter.
Since:
29 Nov 2017
Author:
Mark Taylor
  • Constructor Details

    • PrintSaxMessager

      public PrintSaxMessager(PrintStream out, boolean debug, int maxRepeat)
      Constructor.
      Parameters:
      out - output stream to which messages will be written
      debug - if true, a stack trace will be output with each log message
      maxRepeat - maximum number of identical error messages which will be logged
  • Method Details

    • reportMessage

      public void reportMessage(SaxMessager.Level level, VotLintCode code, String msg, Locator locator)
      Description copied from interface: SaxMessager
      Reports a message.
      Specified by:
      reportMessage in interface SaxMessager
      Parameters:
      level - severity level of the message, not null
      code - message identifier
      msg - message text
      locator - location in the XML document that provoked the message, or null if unknown/inapplicable