Package it.unive.lisa.outputs.json
Class JsonReport
- java.lang.Object
-
- it.unive.lisa.outputs.json.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JsonReport.JsonWarning
A warning that is ready to dump into aJsonReport
.
-
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 givenWriter
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 ofJsonReport.JsonWarning
s contained into this report.int
hashCode()
static JsonReport
read(java.io.Reader reader)
Reads aJsonReport
from aReader
instance, deserializing it as a json object.java.lang.String
toString()
-
-
-
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
-
getWarnings
public java.util.Collection<JsonReport.JsonWarning> getWarnings()
Yields the collection ofJsonReport.JsonWarning
s contained into this report.- Returns:
- the collection of warnings
-
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 byLiSAConfiguration.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 byLiSARunInfo.toPropertyBag()
.- Returns:
- the configuration
-
dump
public void dump(java.io.Writer writer) throws java.io.IOException
Dumps this report to the givenWriter
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 aJsonReport
from aReader
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 classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-