public class ElementAttributesFilter extends AElementFilter
ALL, NONE
Constructor and Description |
---|
ElementAttributesFilter()
Creates a new filter with no attributes defined.
|
ElementAttributesFilter(java.util.Map<java.lang.String,java.lang.String> attributes)
Creates a new filter that matches all elements that have all
the given attributes with the same value.
|
ElementAttributesFilter(java.lang.String... keyValuePairs)
Creates a new filter that matches all elements that have all
the given attributes with the same value.
|
Modifier and Type | Method and Description |
---|---|
protected java.util.Map<java.lang.String,java.lang.String> |
getAttributes() |
protected boolean |
matchesElement(Element element)
Returns whether or not the given element matches this filter.
|
matches
public ElementAttributesFilter()
public ElementAttributesFilter(java.util.Map<java.lang.String,java.lang.String> attributes)
attributes
- The attributes an element must match.public ElementAttributesFilter(java.lang.String... keyValuePairs)
keyValuePairs
- The attributes an element must match.
Each string must contain a key and value separated by ":" or "=".
Example: new ElementAttributesFilter("a=1", "b=2", "c:3")protected java.util.Map<java.lang.String,java.lang.String> getAttributes()
protected boolean matchesElement(Element element)
AElementFilter
matchesElement
in class AElementFilter
element
- The element to check against the filter.