Class NewDifferenceEngine.IsBetweenDocumentNodeAndRootElement

java.lang.Object
org.custommonkey.xmlunit.NewDifferenceEngine.IsBetweenDocumentNodeAndRootElement
All Implemented Interfaces:
ComparisonListener
Enclosing class:
NewDifferenceEngine

private static class NewDifferenceEngine.IsBetweenDocumentNodeAndRootElement extends Object implements ComparisonListener
Tests whether the DifferenceEngine is currently processing comparisons of "things" between the document node and the document's root element (comments or PIs, mostly) since these must be ignored for backwards compatibility reasons.

Relies on the following assumptions:

  • the last comparison DOMDifferenceEngine performs on the document node is an XML_ENCODING comparison.
  • the first comparison DOMDifferenceEngine performs on matching root elements is a NODE_TYPE comparison. The control Node is an Element Node.
  • the first comparison DOMDifferenceEngine performs if the root elements don't match is a CHILD_LOOKUP comparison. The control Node is an Element Node.

  • Field Details

    • haveSeenXmlEncoding

      private boolean haveSeenXmlEncoding
    • haveSeenElementNodeComparison

      private boolean haveSeenElementNodeComparison
  • Constructor Details

    • IsBetweenDocumentNodeAndRootElement

      private IsBetweenDocumentNodeAndRootElement()
  • Method Details

    • comparisonPerformed

      public void comparisonPerformed(Comparison comparison, ComparisonResult outcome)
      Description copied from interface: ComparisonListener
      Receives information about a comparison that has been performed and its outcome.
      Specified by:
      comparisonPerformed in interface ComparisonListener
      Parameters:
      comparison - the comparison
      outcome - the result of the comparison
    • shouldSkip

      private boolean shouldSkip()