Package io.codemodder

Class LazyLoadingRuleSarif

java.lang.Object
io.codemodder.LazyLoadingRuleSarif
All Implemented Interfaces:
RuleSarif

public class LazyLoadingRuleSarif extends Object implements RuleSarif
A RuleSarif that lazily loads an underlying RuleSarif when needed. This can be used to delay execution.
  • Constructor Details

    • LazyLoadingRuleSarif

      public LazyLoadingRuleSarif(javax.inject.Provider<RuleSarif> ruleSarifProvider)
  • Method Details

    • getRegionsFromResultsByRule

      public List<com.contrastsecurity.sarif.Region> getRegionsFromResultsByRule(Path path)
      Description copied from interface: RuleSarif
      Get all the regions for the SARIF with the matching rule ID
      Specified by:
      getRegionsFromResultsByRule in interface RuleSarif
      Parameters:
      path - the file being scanned
      Returns:
      the source code regions where the given rule was found in the given file
    • getResultsByLocationPath

      public List<com.contrastsecurity.sarif.Result> getResultsByLocationPath(Path path)
      Description copied from interface: RuleSarif
      Get all the SARIF results with the matching path for the first location field
      Specified by:
      getResultsByLocationPath in interface RuleSarif
      Parameters:
      path - the file being scanned
      Returns:
      the results associated with the given file
    • rawDocument

      public com.contrastsecurity.sarif.SarifSchema210 rawDocument()
      Description copied from interface: RuleSarif
      Return the entire SARIF as a model in case more comprehensive inspection is needed.
      Specified by:
      rawDocument in interface RuleSarif
    • getRule

      public String getRule()
      Description copied from interface: RuleSarif
      Returns the string ID for the rule.
      Specified by:
      getRule in interface RuleSarif
    • getDriver

      public String getDriver()
      Description copied from interface: RuleSarif
      Returns the tool driver that produced this SARIF.
      Specified by:
      getDriver in interface RuleSarif