|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.htmlparser.filters.HasAttributeFilter
This class accepts all tags that have a certain attribute, and optionally, with a certain value.
| Field Summary | |
protected java.lang.String |
mAttribute
The attribute to check for. |
protected java.lang.String |
mValue
The value to check for. |
| Constructor Summary | |
HasAttributeFilter()
Creates a new instance of HasAttributeFilter. |
|
HasAttributeFilter(java.lang.String attribute)
Creates a new instance of HasAttributeFilter that accepts tags with the given attribute. |
|
HasAttributeFilter(java.lang.String attribute,
java.lang.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. |
java.lang.String |
getAttributeName()
Get the attribute name. |
java.lang.String |
getAttributeValue()
Get the attribute value. |
void |
setAttributeName(java.lang.String name)
Set the attribute name. |
void |
setAttributeValue(java.lang.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 java.lang.String mAttribute
protected java.lang.String mValue
| Constructor Detail |
public HasAttributeFilter()
false
from accept(org.htmlparser.Node).
public HasAttributeFilter(java.lang.String attribute)
attribute - The attribute to search for.
public HasAttributeFilter(java.lang.String attribute,
java.lang.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 java.lang.String getAttributeName()
public void setAttributeName(java.lang.String name)
name - The name of the attribute to accept.public java.lang.String getAttributeValue()
public void setAttributeValue(java.lang.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 NodeFilternode - The node to check.
true if the node has the attribute
(and value if that is being checked too), false otherwise.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||