java.io.Serializable, java.lang.Cloneable, NodeFilterpublic class LinkRegexFilter extends java.lang.Object implements NodeFilter
| Modifier and Type | Field | Description |
|---|---|---|
protected java.util.regex.Pattern |
mRegex |
The regular expression to use on the link.
|
| Constructor | Description |
|---|---|
LinkRegexFilter(java.lang.String regexPattern) |
Creates a LinkRegexFilter that accepts LinkTag nodes containing
a URL that matches the supplied regex pattern.
|
LinkRegexFilter(java.lang.String regexPattern,
boolean caseSensitive) |
Creates a LinkRegexFilter that accepts LinkTag nodes containing
a URL that matches the supplied regex pattern.
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
accept(Node node) |
Accept nodes that are a LinkTag and have a URL
that matches the regex pattern supplied in the constructor.
|
protected java.util.regex.Pattern mRegex
public LinkRegexFilter(java.lang.String regexPattern)
regexPattern - The pattern to match.public LinkRegexFilter(java.lang.String regexPattern,
boolean caseSensitive)
regexPattern - The regex pattern to match.caseSensitive - Specifies case sensitivity for the matching process.public boolean accept(Node node)
accept in interface NodeFilternode - The node to check.true if the node is a link with the pattern.HTML Parser is an open source library released under LGPL.