java.io.Serializable, java.lang.Cloneable, NodeFilterpublic class HasChildFilter extends java.lang.Object implements NodeFilter
| Modifier and Type | Field | Description |
|---|---|---|
protected NodeFilter |
mChildFilter |
The filter to apply to children.
|
protected boolean |
mRecursive |
Performs a recursive search down the node heirarchy if
true. |
| Constructor | Description |
|---|---|
HasChildFilter() |
Creates a new instance of a HasChildFilter.
|
HasChildFilter(NodeFilter filter) |
Creates a new instance of HasChildFilter that accepts nodes
with a direct child acceptable to the filter.
|
HasChildFilter(NodeFilter filter,
boolean recursive) |
Creates a new instance of HasChildFilter that accepts nodes
with a child acceptable to the filter.
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
accept(Node node) |
Accept tags with children acceptable to the filter.
|
NodeFilter |
getChildFilter() |
Get the filter used by this HasParentFilter.
|
boolean |
getRecursive() |
Get the recusion setting for the filter.
|
void |
setChildFilter(NodeFilter filter) |
Set the filter for this HasParentFilter.
|
void |
setRecursive(boolean recursive) |
Sets whether the filter is recursive or not.
|
protected NodeFilter mChildFilter
protected boolean mRecursive
true.public HasChildFilter()
false
from accept(org.htmlparser.Node).public HasChildFilter(NodeFilter filter)
filter - The filter to apply to the children.public HasChildFilter(NodeFilter filter, boolean recursive)
filter - The filter to apply to children.recursive - If true, any enclosed node acceptable
to the given filter causes the node being tested to be accepted
(i.e. a recursive scan through the child nodes down the node
heirarchy is performed).public NodeFilter getChildFilter()
public void setChildFilter(NodeFilter filter)
filter - The filter to apply to parents in accept(org.htmlparser.Node).public boolean getRecursive()
true if the filter is recursive
up the node heirarchy.public void setRecursive(boolean recursive)
recursive - The recursion setting for the filter.public boolean accept(Node node)
accept in interface NodeFilternode - The node to check.true if the node has an acceptable child,
false otherwise.HTML Parser is an open source library released under LGPL.