Class PatchDiffRenderer

java.lang.Object
org.variantsync.diffdetective.variation.diff.render.PatchDiffRenderer

public class PatchDiffRenderer extends Object
A wrapper for a VariationDiffRenderer for rendering PatchDiffs. Next to rendering, a PatchDiffRenderer also writes the diff of a given patch to a file at the same directory. A PatchDiffRenderer also provides facilities for debug rendering upon errors.
Author:
Paul Bittner
  • Field Details

  • Constructor Details

    • PatchDiffRenderer

      public PatchDiffRenderer(VariationDiffRenderer renderer, RenderOptions<? super DiffLinesLabel> options)
      Creates a PatchDiffRenderer wrapping the given renderer and rendering patches with the given options.
      Parameters:
      renderer - The renderer to use when rendering PatchDiffs.
      options - Options to use for all render calls.
  • Method Details

    • ErrorRendering

      public static PatchDiffRenderer ErrorRendering(VariationDiffRenderer renderer)
      Creates a new PatchDiffRenderer for rendering patches relevant to the occurrence of an error. This method and the returned renderer are mainly intended to be used for debugging.
      Parameters:
      renderer - The renderer to use for error rendering of PatchDiffs.
      Returns:
      A PatchDiffRenderer that may be used for debug error renderring.
    • render

      public void render(PatchDiff patch, Path outputDirectory)
      Renders the given patch to the given output directory.
      Parameters:
      patch - The patch to render.
      outputDirectory - The directory to which the rendered image should be written.
      See Also:
    • render

      public void render(VariationDiff<? extends DiffLinesLabel> variationDiff, GitPatch patch, Path outputDirectory)
      Renders the given VariationDiff that originated from the given patch to the given output directory.
      Parameters:
      variationDiff - The tree to render.
      patch - The patch from which the given tree was created.
      outputDirectory - The directory to which the rendered image should be written.