Class FindGitProvenance

All Implemented Interfaces:
Cloneable

public class FindGitProvenance extends ScanningRecipe<Set<GitProvenance>>
  • Constructor Details

    • FindGitProvenance

      public FindGitProvenance()
  • Method Details

    • getDisplayName

      public String getDisplayName()
      Description copied from class: Recipe
      A human-readable display name for the recipe, initial capped with no period. For example, "Find text". The display name can be assumed to be rendered in documentation and other places where markdown is understood, so it is possible to use stylistic markers like backticks to indicate types. For example, "Find uses of `java.util.List`".
      Specified by:
      getDisplayName in class Recipe
      Returns:
      The display name.
    • getDescription

      public String getDescription()
      Description copied from class: Recipe
      A human-readable description for the recipe, consisting of one or more full sentences ending with a period.

      "Find methods by pattern." is an example. The description can be assumed to be rendered in documentation and other places where markdown is understood, so it is possible to use stylistic markers like backticks to indicate types. For example, "Find uses of `java.util.List`.".

      Specified by:
      getDescription in class Recipe
      Returns:
      The display name.
    • getInitialValue

      public Set<GitProvenance> getInitialValue(ExecutionContext ctx)
      Specified by:
      getInitialValue in class ScanningRecipe<Set<GitProvenance>>
      Returns:
      The initial value of the accumulator before any source files have been iterated over.
    • getScanner

      public TreeVisitor<?,ExecutionContext> getScanner(Set<GitProvenance> provenances)
      Description copied from class: ScanningRecipe
      A visitor that is called for each source file in the repository in an initial pass. Scanning data should be accumulated to acc. The first source file to visit will receive an acc value that is supplied by ScanningRecipe.getInitialValue(ExecutionContext).
      Any changes that the scanning visitor makes to the source file will be discarded.
      Specified by:
      getScanner in class ScanningRecipe<Set<GitProvenance>>
      Parameters:
      provenances - The accumulated scanning data.
      Returns:
      A visitor that is called to collect scanning data on each source file.
    • generate

      public Collection<SourceFile> generate(Set<GitProvenance> provenances, ExecutionContext ctx)
      Description copied from class: ScanningRecipe
      Generate new source files to add to the repository using information collected from scanning.
      Overrides:
      generate in class ScanningRecipe<Set<GitProvenance>>
      Parameters:
      provenances - The accumulated scanning data.
      Returns:
      A list of new source files.