HTML Parser Home Page

org.htmlparser.filters
Class HasParentFilter

java.lang.Object
  extended byorg.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.


Field Summary
 NodeFilter mFilter
          The filter to apply to children.
 
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
 

Field Detail

mFilter

public NodeFilter mFilter
The filter to apply to children.

Constructor Detail

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.
Method Detail

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.

© 2004 Somik Raha
Mar 14, 2004

HTML Parser is an open source library released under LGPL.
SourceForge.net