org.htmlparser.filters
public class HasAttributeFilter extends Object implements NodeFilter
Field Summary | |
---|---|
protected String | mAttribute
The attribute to check for. |
protected String | mValue
The value to check for. |
Constructor Summary | |
---|---|
HasAttributeFilter()
Creates a new instance of HasAttributeFilter.
| |
HasAttributeFilter(String attribute)
Creates a new instance of HasAttributeFilter that accepts tags
with the given attribute. | |
HasAttributeFilter(String attribute, String value)
Creates a new instance of HasAttributeFilter that accepts tags
with the given attribute and value. |
Method Summary | |
---|---|
boolean | accept(Node node)
Accept tags with a certain attribute. |
String | getAttributeName()
Get the attribute name. |
String | getAttributeValue()
Get the attribute value. |
void | setAttributeName(String name)
Set the attribute name. |
void | setAttributeValue(String value)
Set the attribute value. |
false
from HasAttributeFilter.Parameters: attribute The attribute to search for.
Parameters: attribute The attribute to search for. value The value that must be matched, or null if any value will match.
Parameters: node The node to check.
Returns: true
if the node has the attribute
(and value if that is being checked too), false
otherwise.
Returns: Returns the name of the attribute that is acceptable.
Returns: Returns the value of the attribute that is acceptable.
Parameters: name The name of the attribute to accept.
Parameters: value The value of the attribute to accept.
If null
, any tag with the attribute,
no matter what it's value is acceptable.
HTML Parser is an open source library released under LGPL. | |