org.htmlparser.filters
Class HasParentFilter
java.lang.Object
org.htmlparser.filters.HasParentFilter
- All Implemented Interfaces:
- NodeFilter
- public class HasParentFilter
- extends Object
- implements NodeFilter
This class accepts all tags that have a parent acceptable to the filter.
|
Constructor Summary |
HasParentFilter(NodeFilter filter)
Creates a new instance of HasParentFilter that accepts tags with parent acceptable to the filter. |
|
Method Summary |
boolean |
accept(Node node)
Accept tags with parent acceptable to the filter. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mFilter
public NodeFilter mFilter
- The filter to apply to children.
HasParentFilter
public HasParentFilter(NodeFilter filter)
- Creates a new instance of HasParentFilter that accepts tags with parent acceptable to the filter.
- Parameters:
filter - The filter to apply to the parent.
accept
public boolean accept(Node node)
- Accept tags with parent acceptable to the filter.
- 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.