public abstract class Report
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.List<java.lang.String> |
configurations |
protected java.util.Map<java.lang.String,java.lang.Long> |
messageSummary |
protected java.util.List<java.lang.String> |
parameters |
protected java.io.PrintWriter |
writer |
Constructor and Description |
---|
Report()
Default constructor to initialize report variables.
|
Modifier and Type | Method and Description |
---|---|
void |
addConfiguration(java.lang.String configuration)
Adds the string supplied to the configuration section in the heading of the
report.
|
void |
addParameter(java.lang.String parameter)
Adds the string supplied to the parameter section in the heading of the
report.
|
gov.nasa.pds.tools.label.ExceptionType |
getLevel() |
int |
getNumFailed() |
int |
getNumPassed() |
int |
getNumSkipped() |
int |
getTotalErrors() |
int |
getTotalInfos() |
int |
getTotalWarnings() |
java.lang.String |
getType(java.lang.String systemId) |
boolean |
hasErrors() |
boolean |
hasWarnings() |
void |
printFooter()
Prints out the footer or the report and calls the customized footer
section.
|
protected abstract void |
printFooter(java.io.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(java.io.PrintWriter writer,
java.lang.String title)
Allows a Report to customize the header portion of the Report if necessary.
|
void |
printHeader(java.lang.String title) |
protected abstract void |
printRecordMessages(java.io.PrintWriter writer,
Status status,
java.net.URI sourceUri,
java.util.List<gov.nasa.pds.tools.validate.ValidationProblem> problems)
Allows a report to customize how it handles reporting on a particular
label.
|
protected void |
printRecordSkip(java.io.PrintWriter writer,
java.net.URI sourceUri,
gov.nasa.pds.tools.validate.ValidationProblem problem) |
Status |
record(java.net.URI sourceUri,
java.util.List<gov.nasa.pds.tools.validate.ValidationProblem> problems)
Allows a report to change how they manage reporting on a given file that
has been parsed and validated.
|
Status |
record(java.net.URI sourceUri,
gov.nasa.pds.tools.validate.ValidationProblem problem) |
Status |
recordSkip(java.net.URI sourceUri,
gov.nasa.pds.tools.validate.ValidationProblem problem) |
void |
setLevel(gov.nasa.pds.tools.label.ExceptionType ExceptionType)
Anything at or above the level will be reported.
|
void |
setOutput(java.io.File file)
Handles writing a Report to a
File . |
void |
setOutput(java.io.OutputStream os)
Handle writing a Report to an
OutputStream . |
void |
setOutput(java.io.Writer writer)
Handles writing a Report to the writer interface.
|
protected java.util.Map<java.lang.String,java.lang.Long> |
sortMessageSummary(java.util.Map<java.lang.String,java.lang.Long> messageSummary) |
protected final java.util.List<java.lang.String> parameters
protected final java.util.List<java.lang.String> configurations
protected java.io.PrintWriter writer
protected java.util.Map<java.lang.String,java.lang.Long> messageSummary
public Report()
public void setOutput(java.io.Writer writer)
StringWriter
.writer
- which the report will be written topublic void setOutput(java.io.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 void setOutput(java.io.File file) throws java.io.IOException
File
.file
- which the report will output tojava.io.IOException
- if there is an issue in writing the report to the filepublic void printHeader()
public void addParameter(java.lang.String parameter)
parameter
- in a string form that represents something that was passed in when
the tool was runpublic void addConfiguration(java.lang.String configuration)
configuration
- in a string form that represents a configuration that was used
during parsing and validationpublic void printHeader(java.lang.String title)
protected abstract void printHeader(java.io.PrintWriter writer, java.lang.String title)
writer
- passed down to write header contents topublic Status record(java.net.URI sourceUri, gov.nasa.pds.tools.validate.ValidationProblem problem)
public Status record(java.net.URI sourceUri, java.util.List<gov.nasa.pds.tools.validate.ValidationProblem> problems)
sourceUri
- reference to the file that is being reported onproblems
- the set of issues found with the file. to be reported onprotected java.util.Map<java.lang.String,java.lang.Long> sortMessageSummary(java.util.Map<java.lang.String,java.lang.Long> messageSummary)
public Status recordSkip(java.net.URI sourceUri, gov.nasa.pds.tools.validate.ValidationProblem problem)
protected void printRecordSkip(java.io.PrintWriter writer, java.net.URI sourceUri, gov.nasa.pds.tools.validate.ValidationProblem problem)
protected abstract void printRecordMessages(java.io.PrintWriter writer, Status status, java.net.URI sourceUri, java.util.List<gov.nasa.pds.tools.validate.ValidationProblem> 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(java.io.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(gov.nasa.pds.tools.label.ExceptionType ExceptionType)
ExceptionType
- level on which items will be reportedpublic gov.nasa.pds.tools.label.ExceptionType getLevel()
public java.lang.String getType(java.lang.String systemId)
Copyright © 2010-2019 Planetary Data System. All Rights Reserved.