Package com.crawljax.oraclecomparator
Class AbstractComparator
- java.lang.Object
-
- com.crawljax.oraclecomparator.AbstractComparator
-
- All Implemented Interfaces:
Comparator
- Direct Known Subclasses:
AttributeComparator,DummyComparator,EditDistanceComparator,PlainStructureComparator,RegexComparator,ScriptComparator,SimpleComparator,StyleComparator,XPathExpressionComparator
@NotThreadSafe public abstract class AbstractComparator extends Object implements Comparator
The Abstract base class of all the Comparators. All comparators are not Thread safe as comparators are shared between Threads and the originalDom and newDom can not be final.
-
-
Constructor Summary
Constructors Constructor Description AbstractComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<org.custommonkey.xmlunit.Difference>getDifferences(String oldDom, String newDom)booleanisEquivalent(String oldDom, String newDom)Stringnormalize(String dom)Override this method to apply normalization to the comparison.
-
-
-
Method Detail
-
getDifferences
public List<org.custommonkey.xmlunit.Difference> getDifferences(String oldDom, String newDom)
- Specified by:
getDifferencesin interfaceComparator- Returns:
- The differences between the two DOMs
-
isEquivalent
public boolean isEquivalent(String oldDom, String newDom)
- Specified by:
isEquivalentin interfaceComparator- Returns:
- if the originalDom and the newDom are equivalent
-
normalize
public String normalize(String dom)
Override this method to apply normalization to the comparison.- Specified by:
normalizein interfaceComparator- Parameters:
dom- The original DOM- Returns:
- the normalized DOM.
-
-