Class PatchDiffRenderer
java.lang.Object
org.variantsync.diffdetective.variation.diff.render.PatchDiffRenderer
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final RenderOptions<DiffLinesLabel> Default RenderOptions for debug rendering of VariationDiffs relevant to the occurrence of an error.private final RenderOptions<? super DiffLinesLabel> private final VariationDiffRenderer -
Constructor Summary
ConstructorsConstructorDescriptionPatchDiffRenderer(VariationDiffRenderer renderer, RenderOptions<? super DiffLinesLabel> options) Creates a PatchDiffRenderer wrapping the given renderer and rendering patches with the given options. -
Method Summary
Modifier and TypeMethodDescriptionstatic PatchDiffRendererErrorRendering(VariationDiffRenderer renderer) Creates a new PatchDiffRenderer for rendering patches relevant to the occurrence of an error.voidRenders the given patch to the given output directory.voidrender(VariationDiff<? extends DiffLinesLabel> variationDiff, GitPatch patch, Path outputDirectory) Renders the given VariationDiff that originated from the given patch to the given output directory.
-
Field Details
-
ErrorVariationDiffRenderOptions
Default RenderOptions for debug rendering of VariationDiffs relevant to the occurrence of an error. -
renderer
-
options
-
-
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
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
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.
-