Package uk.ac.starlink.ttools.taplint
Class TextOutputReporter
- java.lang.Object
-
- uk.ac.starlink.ttools.taplint.TextOutputReporter
-
- All Implemented Interfaces:
OutputReporter,Reporter
public class TextOutputReporter extends java.lang.Object implements OutputReporter
OutputReporter implementation for logging plain text to a print stream.- Since:
- 24 May 2016
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description TextOutputReporter(java.io.PrintStream out, ReportType[] types, int maxRepeat, boolean debug, int maxChar)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidend()Signals end of reporting.voidendSection()Ends the current section.java.lang.StringgetSectionCode()Returns the section code for the most recently-started section.voidreport(ReportCode code, java.lang.String message)Reports a message.voidreport(ReportCode code, java.lang.String message, java.lang.Throwable err)Reports a message with an associated throwable.voidstart(java.lang.String[] announcements)Signals beginning of reporting.voidstartSection(java.lang.String scode, java.lang.String message)Begins a reporting section.voidsummariseUnreportedMessages(java.lang.String scode)Writes to the output stream a summary of messages which were suppressed in a given stage because the maximum repeat count was exceeded.
-
-
-
Constructor Detail
-
TextOutputReporter
public TextOutputReporter(java.io.PrintStream out, ReportType[] types, int maxRepeat, boolean debug, int maxChar)Constructor.- Parameters:
out- destination streamtypes- message types to report; others are discardedmaxRepeat- maximum number of times any given message may be repeated; subsequent instances are suppresseddebug- true iff you want to see full stacktraces for exceptions etcmaxChar- maximum number of total characters per line of output
-
-
Method Detail
-
start
public void start(java.lang.String[] announcements)
Description copied from interface:OutputReporterSignals beginning of reporting.- Specified by:
startin interfaceOutputReporter- Parameters:
announcements- header information about validator operation; plain text, one line per element
-
end
public void end()
Description copied from interface:OutputReporterSignals end of reporting.- Specified by:
endin interfaceOutputReporter
-
startSection
public void startSection(java.lang.String scode, java.lang.String message)Description copied from interface:OutputReporterBegins a reporting section.- Specified by:
startSectionin interfaceOutputReporter- Parameters:
scode- short fixed-length (3-char?) identifier for the section about to startmessage- terse (one-line) free-text description of the stage
-
getSectionCode
public java.lang.String getSectionCode()
Description copied from interface:OutputReporterReturns the section code for the most recently-started section.- Specified by:
getSectionCodein interfaceOutputReporter- Returns:
- current section code
-
summariseUnreportedMessages
public void summariseUnreportedMessages(java.lang.String scode)
Description copied from interface:OutputReporterWrites to the output stream a summary of messages which were suppressed in a given stage because the maximum repeat count was exceeded.- Specified by:
summariseUnreportedMessagesin interfaceOutputReporter- Parameters:
scode- section code to summarise; if null, no stage filtering is done
-
endSection
public void endSection()
Description copied from interface:OutputReporterEnds the current section.- Specified by:
endSectionin interfaceOutputReporter
-
report
public void report(ReportCode code, java.lang.String message)
Description copied from interface:ReporterReports a message.This convenience method is equivalent to calling
report(code,message,null)
-
report
public void report(ReportCode code, java.lang.String message, java.lang.Throwable err)
Description copied from interface:ReporterReports a message with an associated throwable.
-
-