Package org.xmlunit.diff
Interface ComparisonFormatter
-
- All Known Implementing Classes:
DefaultComparisonFormatter
public interface ComparisonFormatter
Formatter methods for aComparison
Object.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getDescription(Comparison difference)
Return a short String of the Comparison including the XPath and the shorten value of the effected control and test Node.java.lang.String
getDetails(Comparison.Detail details, ComparisonType type, boolean formatXml)
Return the xml node fromComparison.Detail.getTarget()
as formatted String.
-
-
-
Method Detail
-
getDescription
java.lang.String getDescription(Comparison difference)
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
java.lang.String getDetails(Comparison.Detail details, ComparisonType type, boolean formatXml)
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.
-
-