Package gov.nasa.pds.validate.report
Class JSONReport
- java.lang.Object
-
- gov.nasa.pds.validate.report.Report
-
- gov.nasa.pds.validate.report.JSONReport
-
public class JSONReport extends Report
This class represents a full report in JSON format.- Author:
- mcayanan
-
-
Field Summary
-
Fields inherited from class gov.nasa.pds.validate.report.Report
configurations, integrityCheckFlag, messageSummary, numProducts, parameters, totalIntegrityChecks, totalProducts, writer
-
-
Constructor Summary
Constructors Constructor Description JSONReport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
printFooter()
Prints out the footer or the report and calls the customized footer section.protected void
printFooter(PrintWriter writer)
Allows customization of the footer section of the reportvoid
printHeader()
This method will display the default header for the Vtool command line library reports.protected void
printHeader(PrintWriter writer, String title)
Allows a Report to customize the header portion of the Report if necessary.protected void
printRecordMessages(PrintWriter writer, Status status, URI sourceUri, List<ValidationProblem> problems)
Allows a report to customize how it handles reporting on a particular label.protected void
printRecordSkip(PrintWriter writer, URI sourceUri, ValidationProblem problem)
void
setOutput(File file)
Handles writing a Report to aFile
.void
setOutput(OutputStream os)
Handle writing a Report to anOutputStream
.void
setOutput(Writer writer)
Handles writing a Report to the writer interface.-
Methods inherited from class gov.nasa.pds.validate.report.Report
addConfiguration, addParameter, enableDeprecatedFlagWarning, getLevel, getNumFailed, getNumPassed, getNumSkipped, getTotalErrors, getTotalInfos, getTotalIntegrityChecks, getTotalProducts, getTotalWarnings, getType, hasErrors, hasWarnings, printHeader, record, record, recordSkip, setLevel, sortMessageSummary
-
-
-
-
Method Detail
-
setOutput
public void setOutput(Writer writer)
Handles writing a Report to the writer interface. This is is useful if someone would like to put the contents of the Report to something such asStringWriter
.
-
setOutput
public void setOutput(OutputStream os)
Handle writing a Report to anOutputStream
. This is useful to get the report to print to something such as System.out
-
setOutput
public void setOutput(File file) throws IOException
Handles writing a Report to aFile
.- Overrides:
setOutput
in classReport
- Parameters:
file
- which the report will output to- Throws:
IOException
- if there is an issue in writing the report to the file
-
printHeader
public void printHeader()
Description copied from class:Report
This method will display the default header for the Vtool command line library reports. This is the standard header across all reports.- Overrides:
printHeader
in classReport
-
printHeader
protected void printHeader(PrintWriter writer, String title)
Description copied from class:Report
Allows a Report to customize the header portion of the Report if necessary.- Specified by:
printHeader
in classReport
- Parameters:
writer
- passed down to write header contents to
-
printRecordMessages
protected void printRecordMessages(PrintWriter writer, Status status, URI sourceUri, List<ValidationProblem> problems)
Description copied from class:Report
Allows a report to customize how it handles reporting on a particular label.- Specified by:
printRecordMessages
in classReport
- Parameters:
writer
- passed on to write customized messages tosourceUri
- reference to the file that is being reported onproblems
- which to report on for this source
-
printRecordSkip
protected void printRecordSkip(PrintWriter writer, URI sourceUri, ValidationProblem problem)
- Overrides:
printRecordSkip
in classReport
-
printFooter
protected void printFooter(PrintWriter writer)
Description copied from class:Report
Allows customization of the footer section of the report- Specified by:
printFooter
in classReport
- Parameters:
writer
- passed on to writer customized footer contents
-
printFooter
public void printFooter()
Description copied from class:Report
Prints out the footer or the report and calls the customized footer section.- Overrides:
printFooter
in classReport
-
-