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​(LiSAReport report)
      Builds the report, starting from the given one.
    • 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.Map<java.lang.String,​java.lang.String> getConfiguration()
      Yields the configuration of the analysis, in the form of a property bag.
      java.util.Collection<java.lang.String> getFiles()
      Yields the collection of file names contained into this report.
      java.util.Map<java.lang.String,​java.lang.String> getInfo()
      Yields the information about the analysis ran, in the form of a property bag.
      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​(LiSAReport report)
        Builds the report, starting from the given one.
        Parameters:
        report - the original report
    • 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
      • getConfiguration

        public java.util.Map<java.lang.String,​java.lang.String> getConfiguration()
        Yields the configuration of the analysis, in the form of a property bag. This corresponds to the object returned by LiSAConfiguration.toPropertyBag().
        Returns:
        the configuration
      • getInfo

        public java.util.Map<java.lang.String,​java.lang.String> getInfo()
        Yields the information about the analysis ran, in the form of a property bag. This corresponds to the object returned by LiSARunInfo.toPropertyBag().
        Returns:
        the configuration
      • 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