Package org.htmlparser.filters
Class TagNameFilter
java.lang.Object
org.htmlparser.filters.TagNameFilter
- All Implemented Interfaces:
Serializable
,Cloneable
,NodeFilter
This class accepts all tags matching the tag name.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of TagNameFilter.TagNameFilter
(String name) Creates a TagNameFilter that accepts tags with the given name. -
Method Summary
-
Field Details
-
mName
The tag name to match.
-
-
Constructor Details
-
TagNameFilter
public TagNameFilter()Creates a new instance of TagNameFilter. With no name, this would always returnfalse
fromaccept(org.htmlparser.Node)
. -
TagNameFilter
Creates a TagNameFilter that accepts tags with the given name.- Parameters:
name
- The tag name to match.
-
-
Method Details
-
getName
Get the tag name.- Returns:
- Returns the name of acceptable tags.
-
setName
Set the tag name.- Parameters:
name
- The name of the tag to accept.
-
accept
Accept nodes that are tags and have a matching tag name. This discards non-tag nodes and end tags. The end tags are available on the enclosing non-end tag.- Specified by:
accept
in interfaceNodeFilter
- Parameters:
node
- The node to check.- Returns:
true
if the tag name matches,false
otherwise.
-