Class DiffAnnotator
- java.lang.Object
-
- de.unirostock.sems.bives.algorithm.DiffAnnotator
-
- Direct Known Subclasses:
DefaultDiffAnnotator
public abstract class DiffAnnotator extends Object
The abstract class DiffAnnotator is the central item in the patch annotation infrastructure.- Author:
- Martin Scharm
-
-
Constructor Summary
Constructors Constructor Description DiffAnnotator()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract de.unirostock.sems.comodi.Change
annotateDeletion(de.unirostock.sems.xmlutils.ds.TreeNode node, org.jdom2.Element diffNode, de.unirostock.sems.comodi.ChangeFactory changeFac)
Annotate a deletion.abstract de.unirostock.sems.comodi.Change
annotateInsertion(de.unirostock.sems.xmlutils.ds.TreeNode node, org.jdom2.Element diffNode, de.unirostock.sems.comodi.ChangeFactory changeFac)
Annotate an insertion.abstract de.unirostock.sems.comodi.Change
annotateMove(de.unirostock.sems.xmlutils.ds.TreeNode nodeA, de.unirostock.sems.xmlutils.ds.TreeNode nodeB, org.jdom2.Element diffNode, de.unirostock.sems.comodi.ChangeFactory changeFac, boolean permutation)
Annotate a move.abstract void
annotatePatch(String rootId, de.unirostock.sems.comodi.ChangeFactory changeFac)
Annotate the Patch itself with information about the software used to create this .abstract de.unirostock.sems.comodi.Change
annotateUpdateAttribute(de.unirostock.sems.xmlutils.ds.TreeNode nodeA, de.unirostock.sems.xmlutils.ds.TreeNode nodeB, String attributeName, org.jdom2.Element diffNode, de.unirostock.sems.comodi.ChangeFactory changeFac)
Annotate an update of an attribute value.abstract de.unirostock.sems.comodi.Change
annotateUpdateText(de.unirostock.sems.xmlutils.ds.TextNode nodeA, de.unirostock.sems.xmlutils.ds.TextNode nodeB, org.jdom2.Element diffNode, de.unirostock.sems.comodi.ChangeFactory changeFac)
Annotate an update of a text node.
-
-
-
Method Detail
-
annotatePatch
public abstract void annotatePatch(String rootId, de.unirostock.sems.comodi.ChangeFactory changeFac)
Annotate the Patch itself with information about the software used to create this . As this function might add an annotation about the aggregation of all changes: This function should be called at the very end of the annotation process!- Parameters:
rootId
- the id of the parent node of the patchchangeFac
- the change factory to produce changes
-
annotateDeletion
public abstract de.unirostock.sems.comodi.Change annotateDeletion(de.unirostock.sems.xmlutils.ds.TreeNode node, org.jdom2.Element diffNode, de.unirostock.sems.comodi.ChangeFactory changeFac)
Annotate a deletion.- Parameters:
node
- this node or something in this node was deleteddiffNode
- the node encoding for the differencechangeFac
- the change factory to produce changes- Returns:
- the created change entity, for further processing
-
annotateInsertion
public abstract de.unirostock.sems.comodi.Change annotateInsertion(de.unirostock.sems.xmlutils.ds.TreeNode node, org.jdom2.Element diffNode, de.unirostock.sems.comodi.ChangeFactory changeFac)
Annotate an insertion.- Parameters:
node
- this node or something in this node was inserteddiffNode
- the node encoding for the differencechangeFac
- the change factory to produce changes- Returns:
- the created change entity, for further processing
-
annotateMove
public abstract de.unirostock.sems.comodi.Change annotateMove(de.unirostock.sems.xmlutils.ds.TreeNode nodeA, de.unirostock.sems.xmlutils.ds.TreeNode nodeB, org.jdom2.Element diffNode, de.unirostock.sems.comodi.ChangeFactory changeFac, boolean permutation)
Annotate a move.- Parameters:
nodeA
- this node was movednodeB
- `nodeA` was moved to this placediffNode
- the node encoding for the differencechangeFac
- the change factory to produce changespermutation
- is that just a permutation of nodes under the same parent?- Returns:
- the created change entity, for further processing
-
annotateUpdateAttribute
public abstract de.unirostock.sems.comodi.Change annotateUpdateAttribute(de.unirostock.sems.xmlutils.ds.TreeNode nodeA, de.unirostock.sems.xmlutils.ds.TreeNode nodeB, String attributeName, org.jdom2.Element diffNode, de.unirostock.sems.comodi.ChangeFactory changeFac)
Annotate an update of an attribute value.- Parameters:
nodeA
- the attribute in this node was updatednodeB
- this node contains the final attribute valuediffNode
- the node encoding for the differencechangeFac
- the change factory to produce changesattributeName
- the attribute with this name was updated- Returns:
- the created change entity, for further processing
-
annotateUpdateText
public abstract de.unirostock.sems.comodi.Change annotateUpdateText(de.unirostock.sems.xmlutils.ds.TextNode nodeA, de.unirostock.sems.xmlutils.ds.TextNode nodeB, org.jdom2.Element diffNode, de.unirostock.sems.comodi.ChangeFactory changeFac)
Annotate an update of a text node.- Parameters:
nodeA
- the original text nodenodeB
- the modified text nodediffNode
- the node encoding for the differencechangeFac
- the change factory to produce changes- Returns:
- the created change entity, for further processing
-
-