|
HTML Parser Home Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.htmlparser.filters.HasAttributeFilter
public class HasAttributeFilter
This class accepts all tags that have a certain attribute, and optionally, with a certain value.
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String mAttribute
protected String mValue
Constructor Detail |
---|
public HasAttributeFilter()
false
from accept(org.htmlparser.Node)
.
public HasAttributeFilter(String attribute)
attribute
- The attribute to search for.public HasAttributeFilter(String attribute, String value)
attribute
- The attribute to search for.value
- The value that must be matched,
or null if any value will match.Method Detail |
---|
public String getAttributeName()
public void setAttributeName(String name)
name
- The name of the attribute to accept.public String getAttributeValue()
public void setAttributeValue(String value)
value
- The value of the attribute to accept.
If null
, any tag with the attribute,
no matter what it's value is acceptable.public boolean accept(Node node)
accept
in interface NodeFilter
node
- The node to check.
true
if the node has the attribute
(and value if that is being checked too), false
otherwise.
|
© 2006 Derrick Oswald Sep 17, 2006
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
HTML Parser is an open source library released under Common Public License. |