Package org.xmlunit.diff
Interface ComparisonFormatter
- All Known Implementing Classes:
DefaultComparisonFormatter
public interface ComparisonFormatter
Formatter methods for a
Comparison
Object.-
Method Summary
Modifier and TypeMethodDescriptiongetDescription
(Comparison difference) Return a short String of the Comparison including the XPath and the shorten value of the effected control and test Node.getDetails
(Comparison.Detail details, ComparisonType type, boolean formatXml) Return the xml node fromComparison.Detail.getTarget()
as formatted String.
-
Method Details
-
getDescription
Return a short String of the Comparison including the XPath and the shorten value of the effected control and test Node.This is used for
Diff.toString()
.- Parameters:
difference
- the comparison to describe- Returns:
- a short description of the comparison
-
getDetails
Return the xml node fromComparison.Detail.getTarget()
as formatted String.This can be used to produce a nice compare-View in your IDE (e.g. with org.junit.ComparisonFailure).
- Parameters:
details
- TheComparison.getControlDetails()
orComparison.getTestDetails()
.type
- the implementation can return different details depending on the ComparisonType.formatXml
- set this to true if the Comparison was generated withDiffBuilder.ignoreWhitespace()
.- Returns:
- the full xml node.
-