Class DefaultDiffAnnotator
- java.lang.Object
-
- de.unirostock.sems.bives.algorithm.DiffAnnotator
-
- de.unirostock.sems.bives.algorithm.general.DefaultDiffAnnotator
-
public class DefaultDiffAnnotator extends DiffAnnotator
- Author:
- Martin Scharm
-
-
Constructor Summary
Constructors Constructor Description DefaultDiffAnnotator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.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.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.void
annotatePatch(String rootId, de.unirostock.sems.comodi.ChangeFactory changeFac)
Annotate the Patch itself with information about the software used to create this .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.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
-
annotateDeletion
public de.unirostock.sems.comodi.Change annotateDeletion(de.unirostock.sems.xmlutils.ds.TreeNode node, org.jdom2.Element diffNode, de.unirostock.sems.comodi.ChangeFactory changeFac)
Description copied from class:DiffAnnotator
Annotate a deletion.- Specified by:
annotateDeletion
in classDiffAnnotator
- 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 de.unirostock.sems.comodi.Change annotateInsertion(de.unirostock.sems.xmlutils.ds.TreeNode node, org.jdom2.Element diffNode, de.unirostock.sems.comodi.ChangeFactory changeFac)
Description copied from class:DiffAnnotator
Annotate an insertion.- Specified by:
annotateInsertion
in classDiffAnnotator
- 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 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)
Description copied from class:DiffAnnotator
Annotate a move.- Specified by:
annotateMove
in classDiffAnnotator
- 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 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)
Description copied from class:DiffAnnotator
Annotate an update of an attribute value.- Specified by:
annotateUpdateAttribute
in classDiffAnnotator
- Parameters:
nodeA
- the attribute in this node was updatednodeB
- this node contains the final attribute valueattributeName
- the attribute with this name was updateddiffNode
- the node encoding for the differencechangeFac
- the change factory to produce changes- Returns:
- the created change entity, for further processing
-
annotateUpdateText
public 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)
Description copied from class:DiffAnnotator
Annotate an update of a text node.- Specified by:
annotateUpdateText
in classDiffAnnotator
- 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
-
annotatePatch
public void annotatePatch(String rootId, de.unirostock.sems.comodi.ChangeFactory changeFac)
Description copied from class:DiffAnnotator
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!- Specified by:
annotatePatch
in classDiffAnnotator
- Parameters:
rootId
- the id of the parent node of the patchchangeFac
- the change factory to produce changes
-
-