public abstract class Report extends Object
Modifier and Type | Field and Description |
---|---|
protected List<String> |
configurations |
protected List<String> |
parameters |
protected PrintWriter |
writer |
Constructor and Description |
---|
Report()
Default constructor to initialize report variables.
|
Modifier and Type | Method and Description |
---|---|
void |
addConfiguration(String configuration)
Adds the string supplied to the configuration section in the heading of the
report.
|
void |
addParameter(String parameter)
Adds the string supplied to the parameter section in the heading of the
report.
|
ExceptionType |
getLevel() |
int |
getNumFailed() |
int |
getNumPassed() |
int |
getNumSkipped() |
int |
getTotalErrors() |
int |
getTotalInfos() |
int |
getTotalWarnings() |
boolean |
hasErrors() |
boolean |
hasWarnings() |
void |
printFooter()
Prints out the footer or the report and calls the customized footer
section.
|
protected abstract void |
printFooter(PrintWriter writer)
Allows customization of the footer section of the report
|
void |
printHeader()
This method will display the default header for the Vtool command line
library reports.
|
protected abstract void |
printHeader(PrintWriter writer)
Allows a Report to customize the header portion of the Report if necessary.
|
protected abstract void |
printRecordMessages(PrintWriter writer,
Status status,
URI sourceUri,
List<LabelException> problems)
Allows a report to customize how it handles reporting on a particular
label.
|
protected void |
printRecordSkip(PrintWriter writer,
URI sourceUri,
Exception exception) |
Status |
record(URI sourceUri,
LabelException problem) |
Status |
record(URI sourceUri,
List<LabelException> problems)
Allows a report to change how they manage reporting on a given file that
has been parsed and validated.
|
Status |
recordSkip(URI sourceUri,
Exception exception) |
void |
setLevel(ExceptionType ExceptionType)
Anything at or above the level will be reported.
|
void |
setOutput(File file)
Handles writing a Report to a
File . |
void |
setOutput(OutputStream os)
Handle writing a Report to an
OutputStream . |
void |
setOutput(Writer writer)
Handles writing a Report to the writer interface.
|
protected PrintWriter writer
public Report()
public final void setOutput(Writer writer)
StringWriter
.writer
- which the report will be written topublic final void setOutput(OutputStream os)
OutputStream
. This is useful
to get the report to print to something such as System.outos
- stream which the report will be written topublic final void setOutput(File file) throws IOException
File
.file
- which the report will output toIOException
- if there is an issue in writing the report to the filepublic void printHeader()
public void addParameter(String parameter)
parameter
- in a string form that represents something that was passed in when
the tool was runpublic void addConfiguration(String configuration)
configuration
- in a string form that represents a configuration that was used
during parsing and validationprotected abstract void printHeader(PrintWriter writer)
writer
- passed down to write header contents topublic Status record(URI sourceUri, LabelException problem)
public Status record(URI sourceUri, List<LabelException> problems)
sourceUri
- reference to the file that is being reported onproblems
- the set of issues found with the file. to be reported onprotected void printRecordSkip(PrintWriter writer, URI sourceUri, Exception exception)
protected abstract void printRecordMessages(PrintWriter writer, Status status, URI sourceUri, List<LabelException> problems)
writer
- passed on to write customized messages tosourceUri
- reference to the file that is being reported onproblems
- which to report on for this sourcepublic void printFooter()
protected abstract void printFooter(PrintWriter writer)
writer
- passed on to writer customized footer contentspublic int getNumPassed()
public int getNumFailed()
public int getNumSkipped()
public int getTotalErrors()
public int getTotalWarnings()
public int getTotalInfos()
public boolean hasErrors()
public boolean hasWarnings()
public void setLevel(ExceptionType ExceptionType)
ExceptionType
- level on which items will be reportedpublic ExceptionType getLevel()
Copyright © 2010–2016 Planetary Data System. All rights reserved.