Class RegularDiff


  • public class RegularDiff
    extends Diff
    The Class RegularDiff to compare two regular XML documents.
    Author:
    Martin Scharm
    • Constructor Detail

      • RegularDiff

        public RegularDiff​(File fileA,
                           File fileB)
                    throws de.unirostock.sems.xmlutils.exception.XmlDocumentParseException,
                           IOException,
                           org.jdom2.JDOMException
        Instantiates a new regular diff object in order to compare two documents stored in files fileA and fileB.
        Parameters:
        fileA - the file containing the former version
        fileB - the file containing the later version
        Throws:
        de.unirostock.sems.xmlutils.exception.XmlDocumentParseException - the xml document parse exception
        IOException - Signals that an I/O exception has occurred.
        org.jdom2.JDOMException - the jDOM exception
      • RegularDiff

        public RegularDiff​(String docA,
                           String docB)
                    throws de.unirostock.sems.xmlutils.exception.XmlDocumentParseException,
                           IOException,
                           org.jdom2.JDOMException
        Instantiates a new regular diff object in order to compare two documents stored in strings docA and docB.
        Parameters:
        docA - the former version
        docB - the later version
        Throws:
        de.unirostock.sems.xmlutils.exception.XmlDocumentParseException - the xml document parse exception
        IOException - Signals that an I/O exception has occurred.
        org.jdom2.JDOMException - the jDOM exception
      • RegularDiff

        public RegularDiff​(de.unirostock.sems.xmlutils.ds.TreeDocument treeA,
                           de.unirostock.sems.xmlutils.ds.TreeDocument treeB)
        Instantiates a new regular diff object in order to compare two tree documents.
        Parameters:
        treeA - the former version of the tree
        treeB - the later version of the tree
    • Method Detail

      • mapTrees

        public boolean mapTrees​(boolean allowDifferentIds,
                                boolean careAboutNames,
                                boolean stricterNames)
                         throws BivesConnectionException
        Description copied from class: Diff
        Map both trees. This method let's you decide whether
        • mapped entities may have different ids,
        • we specially treat name attributes,
        • we handle names very strictly.
        For default values see Diff.ALLOW_DIFFERENT_IDS, Diff.CARE_ABOUT_NAMES, and Diff.STRICTER_NAMES.
        Specified by:
        mapTrees in class Diff
        Parameters:
        allowDifferentIds - are mapped entities allowed to have different ids?
        careAboutNames - should we care about names?
        stricterNames - should we handle names very strictly?
        Returns:
        true, if successful mapped
        Throws:
        BivesConnectionException
      • getReactionsGraph

        public Object getReactionsGraph​(GraphTranslator gt)
                                 throws Exception
        Description copied from class: Diff
        Returns the graph of the reaction network providing an own graph translator. Might return null if not available.
        Specified by:
        getReactionsGraph in class Diff
        Parameters:
        gt - the graph translator
        Returns:
        the reaction network or null if not available
        Throws:
        Exception - the exception
      • getReactionsGraphML

        public String getReactionsGraphML()
        Description copied from class: Diff
        Returns the graph of the reaction network encoded in GraphML. Might return null if not available.
        Specified by:
        getReactionsGraphML in class Diff
        Returns:
        the reaction network or null if not available
      • getReactionsDotGraph

        public String getReactionsDotGraph()
        Description copied from class: Diff
        Returns the graph of the reaction network encoded in DOT language. Might return null if not available.
        Specified by:
        getReactionsDotGraph in class Diff
        Returns:
        the reaction network or null if not available
      • getHTMLReport

        public String getHTMLReport()
        Description copied from class: Diff
        Returns the report encoded in HTML. Might return null if not available.
        Specified by:
        getHTMLReport in class Diff
        Returns:
        the hTML report or null if not available
      • getMarkDownReport

        public String getMarkDownReport()
        Description copied from class: Diff
        Returns the report encoded MarkDown. Might return null if not available.
        Specified by:
        getMarkDownReport in class Diff
        Returns:
        the mark down report or null if not available
      • getReStructuredTextReport

        public String getReStructuredTextReport()
        Description copied from class: Diff
        Returns the report encoded in ReStructured text. Might return null if not available.
        Specified by:
        getReStructuredTextReport in class Diff
        Returns:
        the ReStructured text report or null if not available
      • getHierarchyGraph

        public String getHierarchyGraph​(GraphTranslator gt)
        Description copied from class: Diff
        Returns the component's hierarchy graph providing an own graph translator. Might return null if not available.
        Specified by:
        getHierarchyGraph in class Diff
        Parameters:
        gt - the graph translator
        Returns:
        the hierarchy graph or null if not available
      • getHierarchyGraphML

        public String getHierarchyGraphML()
        Description copied from class: Diff
        Returns the component's hierarchy graph encoded in GraphML. Might return null if not available.
        Specified by:
        getHierarchyGraphML in class Diff
        Returns:
        the hierarchy graph or null if not available
      • getHierarchyDotGraph

        public String getHierarchyDotGraph()
        Description copied from class: Diff
        Returns the component's hierarchy graph encoded in DOT language. Might return null if not available.
        Specified by:
        getHierarchyDotGraph in class Diff
        Returns:
        the hierarchy graph or null if not available
      • getReactionsJsonGraph

        public String getReactionsJsonGraph()
        Description copied from class: Diff
        Returns the graph of the reaction network encoded in JSON. Might return null if not available.
        Specified by:
        getReactionsJsonGraph in class Diff
        Returns:
        the reaction network or null if not available
      • getHierarchyJsonGraph

        public String getHierarchyJsonGraph()
        Description copied from class: Diff
        Returns the component's hierarchy graph encoded in JSON. Might return null if not available.
        Specified by:
        getHierarchyJsonGraph in class Diff
        Returns:
        the hierarchy graph or null if not available
      • getReport

        public String getReport​(Typesetting ts)
        Description copied from class: Diff
        Returns the report providing an on markup processor. Might return null if not available.
        Specified by:
        getReport in class Diff
        Parameters:
        ts - the ts
        Returns:
        the report or null if not available
      • getReactionsSbgnJsonGraph

        public String getReactionsSbgnJsonGraph()
                                         throws Exception
        Description copied from class: Diff
        Returns the graph of the reaction network encoded in an SBGN-JSON format. Might return null if not available.
        Specified by:
        getReactionsSbgnJsonGraph in class Diff
        Returns:
        the reaction network or null if not available
        Throws:
        Exception - the exception