Package uk.ac.starlink.ttools.votlint
Class PrintSaxMessager
- java.lang.Object
-
- uk.ac.starlink.ttools.votlint.PrintSaxMessager
-
- All Implemented Interfaces:
SaxMessager
public class PrintSaxMessager extends java.lang.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 themaxRepeat
parameter.- Since:
- 29 Nov 2017
- Author:
- Mark Taylor
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface uk.ac.starlink.ttools.votlint.SaxMessager
SaxMessager.Level
-
-
Constructor Summary
Constructors Constructor Description PrintSaxMessager(java.io.PrintStream out, boolean debug, int maxRepeat)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
reportMessage(SaxMessager.Level level, java.lang.String msg, org.xml.sax.Locator locator)
Reports a message.
-
-
-
Constructor Detail
-
PrintSaxMessager
public PrintSaxMessager(java.io.PrintStream out, boolean debug, int maxRepeat)
Constructor.- Parameters:
out
- output stream to which messages will be writtendebug
- if true, a stack trace will be output with each log messagemaxRepeat
- maximum number of identical error messages which will be logged
-
-
Method Detail
-
reportMessage
public void reportMessage(SaxMessager.Level level, java.lang.String msg, org.xml.sax.Locator locator)
Description copied from interface:SaxMessager
Reports a message.- Specified by:
reportMessage
in interfaceSaxMessager
- Parameters:
level
- severity level of the message, not nullmsg
- message textlocator
- location in the XML document that provoked the message, or null if unknown/inapplicable
-
-