Class DefaultDiffAnnotator


  • public class DefaultDiffAnnotator
    extends DiffAnnotator
    Author:
    Martin Scharm
    • 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.
    • Constructor Detail

      • DefaultDiffAnnotator

        public DefaultDiffAnnotator()
    • 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 class DiffAnnotator
        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 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 class DiffAnnotator
        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 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 class DiffAnnotator
        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 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 class DiffAnnotator
        Parameters:
        nodeA - the attribute in this node was updated
        nodeB - this node contains the final attribute value
        attributeName - the attribute with this name was updated
        diffNode - the node encoding for the difference
        changeFac - 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 class DiffAnnotator
        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
      • 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 class DiffAnnotator
        Parameters:
        rootId - the id of the parent node of the patch
        changeFac - the change factory to produce changes