org.htmlparser.filters
Class HasChildFilter
java.lang.Object
org.htmlparser.filters.HasChildFilter
- All Implemented Interfaces:
- NodeFilter
- public class HasChildFilter
- extends Object
- implements NodeFilter
This class accepts all tags that have a child acceptable to the filter.
|
Constructor Summary |
HasChildFilter(NodeFilter filter)
Creates a new instance of HasChildFilter that accepts tags with children acceptable to the filter. |
|
Method Summary |
boolean |
accept(Node node)
Accept tags with children acceptable to the filter. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mFilter
protected NodeFilter mFilter
- The filter to apply to children.
HasChildFilter
public HasChildFilter(NodeFilter filter)
- Creates a new instance of HasChildFilter that accepts tags with children acceptable to the filter.
Similar to asking for the parent of a node returned by the given
filter, but where multiple children may be acceptable, this class
will only accept the parent once.
- Parameters:
filter - The filter to apply to children.
accept
public boolean accept(Node node)
- Accept tags with children 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.