Package com.ibm.dbb.build.report
Class BuildReport
- java.lang.Object
-
- com.ibm.dbb.build.report.BuildReport
-
- Direct Known Subclasses:
NoopBuildReport
public class BuildReport extends java.lang.ObjectThe build report contains a list ofRecord
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROP_RECORD
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddRecord(Record record)Add a record into the build report.RecordfindRecordFromReference(Reference reference)Resolve aReferenceto aRecord.voidgenerateHTML(java.io.File htmlFile)Generate the html file from the list of recordsjava.util.List<Record>getRecords()Returns a immutable list of records being stored in this build report.static BuildReportparse(java.io.InputStream inputStream)Create a build report from anInputStream.static BuildReportparse(java.io.InputStreamReader inputStreamReader)Create a build report from anInputStreamReader.voidsave(java.io.File outputFile)Save all records stored in this build report to a standard json file.voidsave(java.io.File outputFile, java.lang.String encoding)Deprecated.As of release 2.0.1.2, replaced bysave(File)voidsetRecordFilter(com.ibm.dbb.build.report.record.internal.IRecordFilter recordFilter)Set a filter to determine which records should be included in the build report.com.google.gson.JsonObjecttoJSON()Returns the build report in JSON format.java.lang.StringtoString()Returns the build report in String format.
-
-
-
Field Detail
-
PROP_RECORD
public static final java.lang.String PROP_RECORD
- See Also:
- Constant Field Values
-
-
Method Detail
-
getRecords
public java.util.List<Record> getRecords()
Returns a immutable list of records being stored in this build report.- Returns:
- the list of records.
-
setRecordFilter
public void setRecordFilter(com.ibm.dbb.build.report.record.internal.IRecordFilter recordFilter)
Set a filter to determine which records should be included in the build report.- Parameters:
recordFilter- the filter.
-
addRecord
public void addRecord(Record record)
Add a record into the build report.- Parameters:
record- the record to be added.
-
save
public void save(java.io.File outputFile) throws BuildExceptionSave all records stored in this build report to a standard json file. As per RFC-7159, the json file is encoded UTF-8.- Parameters:
outputFile- the file to store the build report.- Throws:
BuildException- if an error occurs in saving the build report.
-
save
public void save(java.io.File outputFile, java.lang.String encoding) throws BuildExceptionDeprecated.As of release 2.0.1.2, replaced bysave(File)Save all records stored in this build report to a file.- Parameters:
outputFile- the file to store the build report.encoding- the encoding to use to store the build report.- Throws:
BuildException- if an error occurs in saving the build report.
-
parse
public static BuildReport parse(java.io.InputStream inputStream) throws java.io.IOException
Create a build report from anInputStream. Note: The input stream content is assumed to be UTF-8 encoded.- Parameters:
inputStream- the contents of the build report.- Returns:
- the
BuildReportrepresents the contents. - Throws:
java.io.IOException- if an error occurs in reading the contents.
-
parse
public static BuildReport parse(java.io.InputStreamReader inputStreamReader) throws java.io.IOException
Create a build report from anInputStreamReader.- Parameters:
inputStreamReader- the contents of the build report.- Returns:
- the
BuildReportrepresents the contents. - Throws:
java.io.IOException- if an error occurs in reading the contents.
-
toJSON
public com.google.gson.JsonObject toJSON()
Returns the build report in JSON format.- Returns:
- JsonObject that represents the build report.
-
findRecordFromReference
public Record findRecordFromReference(Reference reference)
Resolve aReferenceto aRecord.- Parameters:
reference- to be resolved.- Returns:
Recordthat the reference is pointing to orNULLif no records could be found in this build report.
-
toString
public java.lang.String toString()
Returns the build report in String format.- Overrides:
toStringin classjava.lang.Object- Returns:
Stringthat represents the build report.
-
generateHTML
public void generateHTML(java.io.File htmlFile) throws BuildException, java.io.IOExceptionGenerate the html file from the list of records- Parameters:
htmlFile- the file to write the html out to- Throws:
BuildExceptionjava.io.IOExceptionjava.lang.Exception
-
-