|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nasa.pds.validate.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.
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. |
gov.nasa.pds.tools.label.ExceptionType |
getExceptionType()
|
int |
getNumFailed()
|
int |
getNumPassed()
|
int |
getNumSkipped()
|
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,
URI sourceUri,
List<gov.nasa.pds.tools.label.LabelException> problems)
Allows a report to customize how it handles reporting on a particular label. |
protected void |
printRecordSkip(PrintWriter writer,
URI sourceUri,
Exception exception)
|
Status |
record(URI sourceUri,
gov.nasa.pds.tools.label.LabelException problem)
|
Status |
record(URI sourceUri,
List<gov.nasa.pds.tools.label.LabelException> problems)
Allows a report to change how they manage reporting on a given file that has been parsed and validated. |
void |
setExceptionType(gov.nasa.pds.tools.label.ExceptionType ExceptionType)
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 |
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 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(URI sourceUri, gov.nasa.pds.tools.label.LabelException problem)
public Status record(URI sourceUri, List<gov.nasa.pds.tools.label.LabelException> problems)
sourceUri
- reference to the file that is being reported onproblems
- the set of issues found with the file. to be reported on
protected void printRecordSkip(PrintWriter writer, URI sourceUri, Exception exception)
protected abstract void printRecordMessages(PrintWriter writer, Status status, URI sourceUri, List<gov.nasa.pds.tools.label.LabelException> 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(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 setExceptionType(gov.nasa.pds.tools.label.ExceptionType ExceptionType)
ExceptionType
- level on which items will be reportedpublic gov.nasa.pds.tools.label.ExceptionType getExceptionType()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |