Package org.htmlparser.filters
Class LinkStringFilter
java.lang.Object
org.htmlparser.filters.LinkStringFilter
- All Implemented Interfaces:
Serializable
,Cloneable
,NodeFilter
This class accepts tags of class LinkTag that contain a link matching a given
pattern string. Use this filter to extract LinkTag nodes with URLs containing
the desired string.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
Flag indicating case sensitive/insensitive search.protected String
The pattern to search for in the link. -
Constructor Summary
ConstructorsConstructorDescriptionLinkStringFilter
(String pattern) Creates a LinkStringFilter that accepts LinkTag nodes containing a URL that matches the supplied pattern.LinkStringFilter
(String pattern, boolean caseSensitive) Creates a LinkStringFilter that accepts LinkTag nodes containing a URL that matches the supplied pattern. -
Method Summary
-
Field Details
-
mPattern
The pattern to search for in the link. -
mCaseSensitive
protected boolean mCaseSensitiveFlag indicating case sensitive/insensitive search.
-
-
Constructor Details
-
LinkStringFilter
Creates a LinkStringFilter that accepts LinkTag nodes containing a URL that matches the supplied pattern. The match is case insensitive.- Parameters:
pattern
- The pattern to match.
-
LinkStringFilter
Creates a LinkStringFilter that accepts LinkTag nodes containing a URL that matches the supplied pattern.- Parameters:
pattern
- The pattern to match.caseSensitive
- Specifies case sensitivity for the matching process.
-
-
Method Details
-
accept
Accept nodes that are a LinkTag and have a URL that matches the pattern supplied in the constructor.- Specified by:
accept
in interfaceNodeFilter
- Parameters:
node
- The node to check.- Returns:
true
if the node is a link with the pattern.
-