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.Object
The build report contains a list ofRecord
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROP_RECORD
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addRecord(Record record)
Add a record into the build report.Record
findRecordFromReference(Reference reference)
Resolve aReference
to aRecord
.void
generateHTML(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 BuildReport
parse(java.io.InputStream inputStream)
Create a build report from anInputStream
.static BuildReport
parse(java.io.InputStreamReader inputStreamReader)
Create a build report from anInputStreamReader
.void
save(java.io.File outputFile)
Save all records stored in this build report to a standard json file.void
save(java.io.File outputFile, java.lang.String encoding)
Deprecated.As of release 2.0.1.2, replaced bysave(File)
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.com.google.gson.JsonObject
toJSON()
Returns the build report in JSON format.java.lang.String
toString()
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 BuildException
Save 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 BuildException
Deprecated.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
BuildReport
represents 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
BuildReport
represents 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 aReference
to aRecord
.- Parameters:
reference
- to be resolved.- Returns:
Record
that the reference is pointing to orNULL
if no records could be found in this build report.
-
toString
public java.lang.String toString()
Returns the build report in String format.- Overrides:
toString
in classjava.lang.Object
- Returns:
String
that represents the build report.
-
generateHTML
public void generateHTML(java.io.File htmlFile) throws BuildException, java.io.IOException
Generate the html file from the list of records- Parameters:
htmlFile
- the file to write the html out to- Throws:
BuildException
java.io.IOException
java.lang.Exception
-
-