org.htmlparser.filters
Class NodeClassFilter
java.lang.Object
org.htmlparser.filters.NodeClassFilter
- All Implemented Interfaces:
- NodeFilter
- public class NodeClassFilter
- extends Object
- implements NodeFilter
This class accepts all tags of a given class.
|
Field Summary |
protected Class |
mClass
The class to match. |
|
Constructor Summary |
NodeClassFilter(Class cls)
Creates a new instance of NodeClassFilter that accepts tags of the given class. |
|
Method Summary |
boolean |
accept(Node node)
Accept nodes that are assignable from the class provided in the constructor. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mClass
protected Class mClass
- The class to match.
NodeClassFilter
public NodeClassFilter(Class cls)
- Creates a new instance of NodeClassFilter that accepts tags of the given class.
- Parameters:
cls - The cls to match.
accept
public boolean accept(Node node)
- Accept nodes that are assignable from the class provided in the constructor.
- Specified by:
accept in interface NodeFilter
- Parameters:
node - The node to check.
- Returns:
true if the node is to be kept, false
if it is to be discarded.
HTML Parser is an open source library released under LGPL.