Class RegexComparator
- java.lang.Object
-
- com.crawljax.oraclecomparator.AbstractComparator
-
- com.crawljax.oraclecomparator.comparators.RegexComparator
-
- All Implemented Interfaces:
Comparator
- Direct Known Subclasses:
DateComparator
public class RegexComparator extends AbstractComparator
Regex oracles that strips content from the DOM to check whether the DOMs are equal without the specified regular expressions.- Author:
- dannyroest@gmail.com (Danny Roest)
-
-
Constructor Summary
Constructors Constructor Description RegexComparator(String... regexs)RegexComparator(Collection<String> regexs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringnormalize(String dom)Override this method to apply normalization to the comparison.-
Methods inherited from class com.crawljax.oraclecomparator.AbstractComparator
getDifferences, isEquivalent
-
-
-
-
Field Detail
-
regexs
private final com.google.common.collect.ImmutableList<String> regexs
-
-
Constructor Detail
-
RegexComparator
public RegexComparator(Collection<String> regexs)
-
RegexComparator
public RegexComparator(String... regexs)
-
-
Method Detail
-
normalize
public String normalize(String dom)
Description copied from class:AbstractComparatorOverride this method to apply normalization to the comparison.- Specified by:
normalizein interfaceComparator- Overrides:
normalizein classAbstractComparator- Parameters:
dom- The original DOM- Returns:
- the normalized DOM.
-
-