Class 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.
    • Constructor Detail

      • DiffAnnotator

        public DiffAnnotator()
    • 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 patch
        changeFac - 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 deleted
        diffNode - the node encoding for the difference
        changeFac - 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 inserted
        diffNode - the node encoding for the difference
        changeFac - 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 moved
        nodeB - `nodeA` was moved to this place
        diffNode - the node encoding for the difference
        changeFac - the change factory to produce changes
        permutation - 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 updated
        nodeB - this node contains the final attribute value
        diffNode - the node encoding for the difference
        changeFac - the change factory to produce changes
        attributeName - 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 node
        nodeB - the modified text node
        diffNode - the node encoding for the difference
        changeFac - the change factory to produce changes
        Returns:
        the created change entity, for further processing