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 class
Report.Block
A report is made up of a HEADER, BODY, then FOOTER.protected class
Report.Tuple
-
Constructor Summary
Constructors Constructor Description Report()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addConfiguration(String label, String msg, String value)
void
addParameter(String label, String msg, String value)
protected abstract void
append(ValidationProblem problem)
protected abstract void
append(Status status, String target)
protected abstract void
append(String title)
protected abstract void
appendConfig(String label, String message, String value)
protected abstract void
appendParam(String label, String message, String value)
protected abstract void
begin(Report.Block block)
protected abstract void
end(Report.Block block)
int
getTotalIntegrityChecks()
int
getTotalProducts()
protected String
getType(String systemId)
PrintWriter
getWriter()
void
printFooter()
void
printHeader()
Status
record(URI sourceUri, ValidationProblem problem)
Allow single call that turns it into many.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.Status
recordSkip(URI sourceUri, ValidationProblem problem)
void
setDeprecatedFlagWarning(boolean deprecatedFlagWarning)
void
setLevel(ExceptionType level)
void
setWriter(PrintWriter writer)
void
startBody(String title)
void
stopBody()
protected abstract void
summarizeAddMessage(String msg, long count)
protected abstract void
summarizeDepWarn(String msg)
protected abstract void
summarizeProds(int failed, int passed, int skipped, int total)
protected abstract void
summarizeRefs(int failed, int passed, int skipped, int total)
protected abstract void
summarizeTotals(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()
-
-