|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.custommonkey.xmlunit.Diff
public class Diff
Compares and describes any difference between XML documents.
Two documents are either:
appendMessage
or toString
methods. NB: When comparing documents, the
comparison is halted as soon as the status (identical / similar / different)
is known with certainty. For a list of all differences between the documents
an instance of the DetailedDiff class
can be used
instead.
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 | |
---|---|
protected |
Diff(Diff prototype)
Construct a Diff from a prototypical instance. |
|
Diff(org.w3c.dom.Document controlDoc,
org.w3c.dom.Document testDoc)
Construct a Diff that compares the XML in two Documents |
|
Diff(org.w3c.dom.Document controlDoc,
org.w3c.dom.Document testDoc,
DifferenceEngine comparator)
Construct a Diff that compares the XML in two Documents using a specific DifferenceEngine |
|
Diff(org.w3c.dom.Document controlDoc,
org.w3c.dom.Document testDoc,
DifferenceEngine comparator,
ElementQualifier elementQualifier)
Construct a Diff that compares the XML in two Documents using a specific DifferenceEngine and ElementQualifier |
|
Diff(javax.xml.transform.dom.DOMSource control,
javax.xml.transform.dom.DOMSource test)
Construct a Diff that compares the XML in two JAXP DOMSources |
|
Diff(org.xml.sax.InputSource control,
org.xml.sax.InputSource test)
Construct a Diff that compares the XML read from two JAXP InputSources |
|
Diff(java.io.Reader control,
java.io.Reader test)
Construct a Diff that compares the XML read from two Readers |
|
Diff(java.lang.String control,
java.lang.String test)
Construct a Diff that compares the XML in two Strings |
|
Diff(java.lang.String control,
Transform testTransform)
Construct a Diff that compares the XML in a control Document against the result of a transformation |
Method Summary | |
---|---|
java.lang.StringBuffer |
appendMessage(java.lang.StringBuffer toAppendTo)
Append the message from the result of this Diff instance to a specified StringBuffer |
protected void |
compare()
Top of the recursive comparison execution tree |
int |
differenceFound(Difference difference)
DifferenceListener implementation. |
boolean |
haltComparison(Difference afterDifference)
ComparisonController implementation. |
boolean |
identical()
Return the result of a comparison. |
void |
overrideDifferenceListener(DifferenceListener delegate)
Override the DifferenceListener used to determine how
to handle differences that are found. |
void |
overrideElementQualifier(ElementQualifier delegate)
Override the ElementQualifier used to determine which
control and test nodes are comparable for this difference comparison. |
void |
overrideMatchTracker(MatchTracker delegate)
Override the MatchTracker used to track
successfully matched nodes. |
boolean |
similar()
Return the result of a comparison. |
void |
skippedComparison(org.w3c.dom.Node control,
org.w3c.dom.Node test)
DifferenceListener implementation. |
java.lang.String |
toString()
Get the result of this Diff instance as a String |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Diff(java.lang.String control, java.lang.String test) throws org.xml.sax.SAXException, java.io.IOException
org.xml.sax.SAXException
java.io.IOException
public Diff(java.io.Reader control, java.io.Reader test) throws org.xml.sax.SAXException, java.io.IOException
org.xml.sax.SAXException
java.io.IOException
public Diff(org.w3c.dom.Document controlDoc, org.w3c.dom.Document testDoc)
public Diff(java.lang.String control, Transform testTransform) throws java.io.IOException, javax.xml.transform.TransformerException, org.xml.sax.SAXException
java.io.IOException
javax.xml.transform.TransformerException
org.xml.sax.SAXException
public Diff(org.xml.sax.InputSource control, org.xml.sax.InputSource test) throws org.xml.sax.SAXException, java.io.IOException
org.xml.sax.SAXException
java.io.IOException
public Diff(javax.xml.transform.dom.DOMSource control, javax.xml.transform.dom.DOMSource test)
public Diff(org.w3c.dom.Document controlDoc, org.w3c.dom.Document testDoc, DifferenceEngine comparator)
public Diff(org.w3c.dom.Document controlDoc, org.w3c.dom.Document testDoc, DifferenceEngine comparator, ElementQualifier elementQualifier)
protected Diff(Diff prototype)
prototype
- a prototypical instanceMethod Detail |
---|
protected final void compare()
public boolean similar()
public boolean identical()
public int differenceFound(Difference difference)
overrideDifferenceListener
method has been called then the interpretation of the difference
will be delegated.
differenceFound
in interface DifferenceListener
difference
-
public void skippedComparison(org.w3c.dom.Node control, org.w3c.dom.Node test)
overrideDifferenceListener
method has been called then the call will be delegated
otherwise a message is printed to System.err
.
skippedComparison
in interface DifferenceListener
control
- test
- DifferenceEngine
public boolean haltComparison(Difference afterDifference)
haltComparison
in interface ComparisonController
afterDifference
-
Difference.isRecoverable()
public java.lang.StringBuffer appendMessage(java.lang.StringBuffer toAppendTo)
toAppendTo
-
public java.lang.String toString()
toString
in class java.lang.Object
public void overrideDifferenceListener(DifferenceListener delegate)
DifferenceListener
used to determine how
to handle differences that are found.
delegate
- the DifferenceListener instance to delegate handling to.public void overrideElementQualifier(ElementQualifier delegate)
ElementQualifier
used to determine which
control and test nodes are comparable for this difference comparison.
delegate
- the ElementQualifier instance to delegate to.public void overrideMatchTracker(MatchTracker delegate)
MatchTracker
used to track
successfully matched nodes.
delegate
- the MatchTracker instance to delegate handling to.
|
XMLUnit is hosted by sourceforge.net |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |