public class AttributeValueListSelector extends java.lang.Object implements Selector
The attribute value is considered as a white space-separated list of words. Checks that one of those is exactly the given value.
Equivalent to [attribute~=value]
selector in CSS. Its specificity is (0,0,1,0).
Element.getAttribute(String)
,
SpecificityHelper
Constructor and Description |
---|
AttributeValueListSelector(java.lang.String attribute,
java.lang.String value)
Creates an attribute value list selector.
|
Modifier and Type | Method and Description |
---|---|
boolean |
fit(Element element)
Checks whether or not the given element fits this selector.
|
int |
getSpecificity()
Gets the selector specificity.
|
public AttributeValueListSelector(java.lang.String attribute, java.lang.String value)
attribute
- the attribute to check.value
- the value to check.public boolean fit(Element element)
Selector
public int getSpecificity()
Selector
See CSS for more information about calculating a selector's specificity.
getSpecificity
in interface Selector