Class BuildReport

  • Direct Known Subclasses:
    NoopBuildReport

    public class BuildReport
    extends java.lang.Object
    The build report contains a list of Record
    • 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 a Reference to a Record.
      void generateHTML​(java.io.File htmlFile)
      Generate the html file from the list of records
      java.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 an InputStream.
      static BuildReport parse​(java.io.InputStreamReader inputStreamReader)
      Create a build report from an InputStreamReader.
      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 by save(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.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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 by save(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 an InputStream. 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 an InputStreamReader.
        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 a Reference to a Record.
        Parameters:
        reference - to be resolved.
        Returns:
        Record that the reference is pointing to or NULL 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 class java.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