Package org.htmlparser.filters
Class HasSiblingFilter
java.lang.Object
org.htmlparser.filters.HasSiblingFilter
- All Implemented Interfaces:
Serializable
,Cloneable
,NodeFilter
This class accepts all tags that have a sibling acceptable to another filter.
End tags are not considered to be siblings of any tag.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of HasSiblingFilter.HasSiblingFilter
(NodeFilter filter) Creates a new instance of HasSiblingFilter that accepts nodes with sibling acceptable to the filter. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Accept tags with a sibling acceptable to the filter.Get the filter used by this HasSiblingFilter.void
setSiblingFilter
(NodeFilter filter) Set the filter for this HasSiblingFilter.
-
Field Details
-
mSiblingFilter
The filter to apply to the sibling.
-
-
Constructor Details
-
HasSiblingFilter
public HasSiblingFilter()Creates a new instance of HasSiblingFilter. With no sibling filter, this would always returnfalse
fromaccept(org.htmlparser.Node)
. -
HasSiblingFilter
Creates a new instance of HasSiblingFilter that accepts nodes with sibling acceptable to the filter.- Parameters:
filter
- The filter to apply to the sibling.
-
-
Method Details
-
getSiblingFilter
Get the filter used by this HasSiblingFilter.- Returns:
- The filter to apply to siblings.
-
setSiblingFilter
Set the filter for this HasSiblingFilter.- Parameters:
filter
- The filter to apply to siblings inaccept(org.htmlparser.Node)
.
-
accept
Accept tags with a sibling acceptable to the filter.- Specified by:
accept
in interfaceNodeFilter
- Parameters:
node
- The node to check.- Returns:
true
if the node has an acceptable sibling,false
otherwise.
-