Package gov.nasa.pds.validate.report
Class Report
- java.lang.Object
-
- gov.nasa.pds.validate.report.Report
-
- Direct Known Subclasses:
FullReport,JSONReport,XmlReport
public abstract class Report extends Object
This class is a visitor pattern where the Report uses the abstract methods to define what the visitee should do. While this is not exactly a visitor pattern this implementation was chosen to minimize changes throughout the system as everyone in the universe does not have to pass a visitee now. It is simply embedded in the concrete extension of this class.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classReport.BlockA report is made up of a HEADER, BODY, then FOOTER.protected classReport.Tuple
-
Constructor Summary
Constructors Constructor Description Report()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddConfiguration(String label, String msg, String value)voidaddParameter(String label, String msg, String value)protected abstract voidappend(ValidationProblem problem)protected abstract voidappend(Status status, String target)protected abstract voidappend(String title)protected abstract voidappendConfig(String label, String message, String value)protected abstract voidappendParam(String label, String message, String value)protected abstract voidbegin(Report.Block block)protected abstract voidend(Report.Block block)intgetTotalIntegrityChecks()intgetTotalProducts()protected StringgetType(String systemId)PrintWritergetWriter()voidprintFooter()voidprintHeader()Statusrecord(URI sourceUri, ValidationProblem problem)Allow single call that turns it into many.Statusrecord(URI sourceUri, List<ValidationProblem> problems)Allows a report to change how they manage reporting on a given file that has been parsed and validated.StatusrecordSkip(URI sourceUri, ValidationProblem problem)voidsetDeprecatedFlagWarning(boolean deprecatedFlagWarning)voidsetLevel(ExceptionType level)voidsetWriter(PrintWriter writer)voidstartBody(String title)voidstopBody()protected abstract voidsummarizeAddMessage(String msg, long count)protected abstract voidsummarizeDepWarn(String msg)protected abstract voidsummarizeProds(int failed, int passed, int skipped, int total)protected abstract voidsummarizeRefs(int failed, int passed, int skipped, int total)protected abstract voidsummarizeTotals(int errors, int total, int warnings)
-
-
-
Method Detail
-
append
protected abstract void append(String title)
-
append
protected abstract void append(ValidationProblem problem)
-
begin
protected abstract void begin(Report.Block block)
-
end
protected abstract void end(Report.Block block)
-
summarizeAddMessage
protected abstract void summarizeAddMessage(String msg, long count)
-
summarizeDepWarn
protected abstract void summarizeDepWarn(String msg)
-
summarizeProds
protected abstract void summarizeProds(int failed, int passed, int skipped, int total)
-
summarizeRefs
protected abstract void summarizeRefs(int failed, int passed, int skipped, int total)
-
summarizeTotals
protected abstract void summarizeTotals(int errors, int total, int warnings)
-
getTotalIntegrityChecks
public final int getTotalIntegrityChecks()
-
getTotalProducts
public final int getTotalProducts()
-
getWriter
public final PrintWriter getWriter()
-
printFooter
public final void printFooter()
-
printHeader
public final void printHeader()
-
record
public final Status record(URI sourceUri, ValidationProblem problem)
Allow single call that turns it into many.- Parameters:
sourceUri-problem-- Returns:
-
record
public final Status record(URI sourceUri, List<ValidationProblem> problems)
Allows a report to change how they manage reporting on a given file that has been parsed and validated. Also handles generating a status for a file and generating some summary statistics.- Parameters:
sourceUri- reference to the file that is being reported onproblems- the set of issues found with the file. to be reported on- Returns:
- status of the file (i.e. PASS, FAIL, or SKIP)
-
recordSkip
public Status recordSkip(URI sourceUri, ValidationProblem problem)
-
setDeprecatedFlagWarning
public final void setDeprecatedFlagWarning(boolean deprecatedFlagWarning)
-
setLevel
public final void setLevel(ExceptionType level)
-
setWriter
public final void setWriter(PrintWriter writer)
-
startBody
public final void startBody(String title)
-
stopBody
public final void stopBody()
-
-