Class AbstractJsonReportImporter

java.lang.Object
org.sonar.iac.common.reports.AbstractJsonReportImporter

public abstract class AbstractJsonReportImporter extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final org.sonar.api.batch.sensor.SensorContext
     
    protected static final org.sonarsource.analyzer.commons.internal.json.simple.parser.JSONParser
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractJsonReportImporter(org.sonar.api.batch.sensor.SensorContext context, AnalysisWarningsWrapper analysisWarnings, String warningPrefix)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    protected static int
     
    void
    importReport(File reportFile)
     
    protected org.sonar.api.batch.fs.InputFile
    inputFile(String filename)
     
    protected void
    logWarning(String message)
     
    protected org.sonarsource.analyzer.commons.internal.json.simple.JSONArray
    parseFileAsArray(File reportFile)
     
    protected List<org.sonarsource.analyzer.commons.internal.json.simple.JSONArray>
    parseJson(File reportFile)
     
    protected int
    saveIssues(org.sonarsource.analyzer.commons.internal.json.simple.JSONArray issuesJson)
     
    protected abstract org.sonar.api.batch.sensor.issue.NewExternalIssue
    toExternalIssue(org.sonarsource.analyzer.commons.internal.json.simple.JSONObject issueJson)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • jsonParser

      protected static final org.sonarsource.analyzer.commons.internal.json.simple.parser.JSONParser jsonParser
    • context

      protected final org.sonar.api.batch.sensor.SensorContext context
  • Constructor Details

    • AbstractJsonReportImporter

      protected AbstractJsonReportImporter(org.sonar.api.batch.sensor.SensorContext context, AnalysisWarningsWrapper analysisWarnings, String warningPrefix)
  • Method Details

    • importReport

      public void importReport(File reportFile)
    • parseJson

      protected List<org.sonarsource.analyzer.commons.internal.json.simple.JSONArray> parseJson(File reportFile)
    • parseFileAsArray

      protected org.sonarsource.analyzer.commons.internal.json.simple.JSONArray parseFileAsArray(File reportFile) throws IOException, org.sonarsource.analyzer.commons.internal.json.simple.parser.ParseException
      Throws:
      IOException
      org.sonarsource.analyzer.commons.internal.json.simple.parser.ParseException
    • saveIssues

      protected int saveIssues(org.sonarsource.analyzer.commons.internal.json.simple.JSONArray issuesJson)
    • toExternalIssue

      protected abstract org.sonar.api.batch.sensor.issue.NewExternalIssue toExternalIssue(org.sonarsource.analyzer.commons.internal.json.simple.JSONObject issueJson)
    • logWarning

      protected void logWarning(String message)
    • addUnresolvedPath

      protected void addUnresolvedPath(String path)
    • asInt

      protected static int asInt(Object o)
    • inputFile

      protected org.sonar.api.batch.fs.InputFile inputFile(@Nullable String filename)