org.htmlparser.filters
Class TagNameFilter
- Cloneable, NodeFilter, Serializable
public class TagNameFilter
This class accepts all tags matching the tag name.
protected String | mName- The tag name to match.
|
TagNameFilter()- Creates a new instance of TagNameFilter.
|
TagNameFilter(String name)- Creates a TagNameFilter that accepts tags with the given name.
|
boolean | accept(Node node)- Accept nodes that are tags and have a matching tag name.
|
String | getName()- Get the tag name.
|
void | setName(String name)- Set the tag name.
|
mName
protected String mName
The tag name to match.
TagNameFilter
public TagNameFilter()
Creates a new instance of TagNameFilter.
With no name, this would always return
false
from
accept(Node).
TagNameFilter
public TagNameFilter(String name)
Creates a TagNameFilter that accepts tags with the given name.
name - The tag name to match.
accept
public boolean accept(Node node)
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.
- accept in interface NodeFilter
node - The node to check.
true if the tag name matches,
false otherwise.
getName
public String getName()
Get the tag name.
- Returns the name of acceptable tags.
setName
public void setName(String name)
Set the tag name.
name - The name of the tag to accept.
| © 2005 Derrick Oswald Mai 08, 2008 |
| HTML Parser is an open source library released under LGPL. |  |