Package org.xmlunit.diff
Class ComparisonListenerSupport
java.lang.Object
org.xmlunit.diff.ComparisonListenerSupport
Encapsulates support for
ComparisonListeners so it can be
reused by different implementations of DifferenceEngine.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<ComparisonListener> private final List<ComparisonListener> private final List<ComparisonListener> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRegisters a listener that is notified of each comparison.voidRegisters a listener that is notified of each comparison with outcome other thanComparisonResult.EQUAL.voidRegisters a listener that is notified of each comparison with outcomeComparisonResult.EQUAL.private static voidfire(Comparison comparison, ComparisonResult outcome, List<ComparisonListener> listeners) voidfireComparisonPerformed(Comparison comparison, ComparisonResult outcome) Propagates the result of a comparision to all registered listeners.
-
Field Details
-
compListeners
-
matchListeners
-
diffListeners
-
-
Constructor Details
-
ComparisonListenerSupport
public ComparisonListenerSupport()
-
-
Method Details
-
addComparisonListener
Registers a listener that is notified of each comparison.- Parameters:
l- the listener to add
-
addMatchListener
Registers a listener that is notified of each comparison with outcomeComparisonResult.EQUAL.- Parameters:
l- the listener to add
-
addDifferenceListener
Registers a listener that is notified of each comparison with outcome other thanComparisonResult.EQUAL.- Parameters:
l- the listener to add
-
fireComparisonPerformed
Propagates the result of a comparision to all registered listeners.- Parameters:
comparison- the comparisonoutcome- the result of the comparison
-
fire
private static void fire(Comparison comparison, ComparisonResult outcome, List<ComparisonListener> listeners)
-