Class JsonReport


  • public class JsonReport
    extends java.lang.Object
    A report of an executed analysis that can be dumped in json format, and that can be read from a json file.
    • Constructor Summary

      Constructors 
      Constructor Description
      JsonReport()
      Builds an empty report.
      JsonReport​(java.util.Collection<Warning> warnings, java.util.Collection<java.lang.String> files)
      Builds the report, containing the given warnings and files.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dump​(java.io.Writer writer)
      Dumps this report to the given Writer instance, serializing it as a json object.
      boolean equals​(java.lang.Object obj)  
      java.util.Collection<java.lang.String> getFiles()
      Yields the collection of file names contained into this report.
      java.util.Collection<JsonReport.JsonWarning> getWarnings()
      Yields the collection of JsonReport.JsonWarnings contained into this report.
      int hashCode()  
      static JsonReport read​(java.io.Reader reader)
      Reads a JsonReport from a Reader instance, deserializing it as a json object.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • JsonReport

        public JsonReport()
        Builds an empty report.
      • JsonReport

        public JsonReport​(java.util.Collection<Warning> warnings,
                          java.util.Collection<java.lang.String> files)
        Builds the report, containing the given warnings and files.
        Parameters:
        warnings - the collection of warnings to map to JsonReport.JsonWarnings
        files - the collections of file names to include
    • Method Detail

      • getFiles

        public java.util.Collection<java.lang.String> getFiles()
        Yields the collection of file names contained into this report. These represents the names of the files that have been created during the analysis, and should be interpreted as paths relative to the workdir of the analysis (or the folder containing this report, if this was read from a file).
        Returns:
        the collection of file names
      • dump

        public void dump​(java.io.Writer writer)
                  throws java.io.IOException
        Dumps this report to the given Writer instance, serializing it as a json object.
        Parameters:
        writer - the writer to write to
        Throws:
        java.io.IOException - if some I/O error happens while writing to the writer
      • read

        public static JsonReport read​(java.io.Reader reader)
                               throws java.io.IOException
        Reads a JsonReport from a Reader instance, deserializing it as a json object.
        Parameters:
        reader - the reader to read from
        Returns:
        the read report
        Throws:
        java.io.IOException - if some I/O error happens while reading from the reader
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object