|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nasa.pds.citool.report.Report
public abstract class Report
Abstract class that represents a Report for the Vtool command line API. This class handles basic utilities for reporting and calling customized portions of reports.
Field Summary | |
---|---|
protected List<String> |
configurations
|
protected List<String> |
parameters
|
Constructor Summary | |
---|---|
Report()
Default constructor to initialize report variables. |
Method Summary | |
---|---|
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. |
protected List<gov.nasa.pds.tools.LabelParserException> |
filterProblems(List<gov.nasa.pds.tools.LabelParserException> problems)
|
gov.nasa.pds.tools.constants.Constants.Severity |
getLevel()
|
int |
getNumFailed()
|
int |
getNumPassed()
|
int |
getNumSkipped()
|
PrintWriter |
getOutput()
|
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,
List<String> sourceUris,
List<gov.nasa.pds.tools.LabelParserException> problems)
|
protected abstract void |
printRecordMessages(PrintWriter writer,
Status status,
URI sourceUri,
List<gov.nasa.pds.tools.LabelParserException> problems)
Allows a report to customize how it handles reporting on a particular label. |
protected void |
printRecordSkip(PrintWriter writer,
List<String> sourceUris,
Exception exception)
|
protected void |
printRecordSkip(PrintWriter writer,
URI sourceUri,
Exception exception)
|
Status |
record(File source,
List<gov.nasa.pds.tools.LabelParserException> problems)
|
Status |
record(List<String> sourceUris,
List<gov.nasa.pds.tools.LabelParserException> problems)
Allows a report to change how they manage reporting on a given file that has been parsed and validated. |
Status |
record(URI sourceUri,
List<gov.nasa.pds.tools.LabelParserException> problems)
Allows a report to change how they manage reporting on a given file that has been parsed and validated. |
Status |
recordSkip(List<String> sourceUris,
Exception exception)
|
Status |
recordSkip(URI sourceUri,
Exception exception)
|
void |
setLevel(gov.nasa.pds.tools.constants.Constants.Severity severity)
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final List<String> parameters
protected final List<String> configurations
Constructor Detail |
---|
public Report()
Method Detail |
---|
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.out
os
- stream which the report will be written topublic final void setOutput(File file) throws IOException
File
.
file
- which the report will output to
IOException
- if there is an issue in writing the report to the filepublic final PrintWriter getOutput()
public 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(File source, List<gov.nasa.pds.tools.LabelParserException> problems)
public Status record(URI sourceUri, List<gov.nasa.pds.tools.LabelParserException> problems)
sourceUri
- reference to the file that is being reported onproblems
- the set of issues found with the file. to be reported on
protected List<gov.nasa.pds.tools.LabelParserException> filterProblems(List<gov.nasa.pds.tools.LabelParserException> problems)
public Status record(List<String> sourceUris, List<gov.nasa.pds.tools.LabelParserException> problems)
sourceUris
- reference to the file that is being reported onproblems
- the set of issues found with the file. to be reported on
public Status recordSkip(URI sourceUri, Exception exception)
public Status recordSkip(List<String> sourceUris, Exception exception)
protected void printRecordSkip(PrintWriter writer, URI sourceUri, Exception exception)
protected void printRecordSkip(PrintWriter writer, List<String> sourceUris, Exception exception)
protected abstract void printRecordMessages(PrintWriter writer, Status status, URI sourceUri, List<gov.nasa.pds.tools.LabelParserException> problems)
writer
- passed on to write customized messages tosourceUri
- reference to the file that is being reported onproblems
- which to report on for this sourceprotected abstract void printRecordMessages(PrintWriter writer, Status status, List<String> sourceUris, List<gov.nasa.pds.tools.LabelParserException> problems)
public 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(gov.nasa.pds.tools.constants.Constants.Severity severity)
severity
- level on which items will be reportedpublic gov.nasa.pds.tools.constants.Constants.Severity getLevel()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |