Package org.custommonkey.xmlunit
Class DetailedDiff
java.lang.Object
org.custommonkey.xmlunit.Diff
org.custommonkey.xmlunit.DetailedDiff
- All Implemented Interfaces:
ComparisonController
,DifferenceListener
Compares and describes all the differences between two XML documents.
The document comparison does not stop once the first unrecoverable difference
is found, unlike the Diff class.
Note that because the differences are described relative to some control XML
the list of all differences when A is compared to B will not
necessarily be the same as when B is compared to A.
-
Field Summary
Fields inherited from interface org.custommonkey.xmlunit.DifferenceListener
RETURN_ACCEPT_DIFFERENCE, RETURN_IGNORE_DIFFERENCE_NODES_IDENTICAL, RETURN_IGNORE_DIFFERENCE_NODES_SIMILAR, RETURN_UPGRADE_DIFFERENCE_NODES_DIFFERENT
-
Constructor Summary
ConstructorDescriptionDetailedDiff
(Diff prototype) Create a new instance based on a prototypical Diff instance -
Method Summary
Modifier and TypeMethodDescriptionint
differenceFound
(Difference difference) DifferenceListener implementation.Obtain all the differences found by this instanceboolean
haltComparison
(Difference afterDifference) ComparisonController implementation.Methods inherited from class org.custommonkey.xmlunit.Diff
appendMessage, compare, evaluate, identical, overrideDifferenceListener, overrideElementQualifier, overrideMatchTracker, similar, skippedComparison, toString
-
Constructor Details
-
DetailedDiff
Create a new instance based on a prototypical Diff instance- Parameters:
prototype
- the Diff instance for which more detailed difference information is required
-
-
Method Details
-
differenceFound
DifferenceListener implementation. Add the difference to the list of all differences- Specified by:
differenceFound
in interfaceDifferenceListener
- Overrides:
differenceFound
in classDiff
- Parameters:
difference
- a Difference instance as defined inDifferenceConstants
describing the cause of the difference and containing the detail of the nodes that differ- Returns:
- the value supplied by the superclass implementation
-
haltComparison
ComparisonController implementation.- Specified by:
haltComparison
in interfaceComparisonController
- Overrides:
haltComparison
in classDiff
- Parameters:
afterDifference
- the last Difference passed todifferenceFound
- Returns:
- false always as this class wants to see all differences
- See Also:
-
getAllDifferences
Obtain all the differences found by this instance- Returns:
- a list of
differences
-