Package org.fluentlenium.core.filter
Class AttributeFilter
- java.lang.Object
-
- org.fluentlenium.core.filter.AttributeFilter
-
- All Implemented Interfaces:
SearchFilter
public class AttributeFilter extends java.lang.Object implements SearchFilter
Search filter based on attribute value.
-
-
Constructor Summary
Constructors Constructor Description AttributeFilter(java.lang.String attributeName, java.lang.String value)
Construct a filter with an attribute name and an associated valueAttributeFilter(java.lang.String customAttribute, AbstractMatcher matcher)
Construct a filter with a custom attribute and an associated matcher
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<FluentWebElement>
applyFilter(java.util.Collection<FluentWebElement> elements)
Apply the filter.java.lang.String
getAttribute()
Get the attribute name (lower case).java.lang.String
getCssFilter()
Get the CSS string used by CSS search time filtering.AbstractMatcher
getMatcher()
Get the matcher of this filterboolean
isCssFilterSupported()
Does this filter support filtering at search time with CSS selector.java.lang.String
toString()
-
-
-
Constructor Detail
-
AttributeFilter
public AttributeFilter(java.lang.String attributeName, java.lang.String value)
Construct a filter with an attribute name and an associated value- Parameters:
attributeName
- attribute namevalue
- value to filter
-
AttributeFilter
public AttributeFilter(java.lang.String customAttribute, AbstractMatcher matcher)
Construct a filter with a custom attribute and an associated matcher- Parameters:
customAttribute
- custom attribute namematcher
- matcher
-
-
Method Detail
-
getAttribute
public java.lang.String getAttribute()
Get the attribute name (lower case).- Returns:
- attribute name (lower case)
-
getMatcher
public AbstractMatcher getMatcher()
Get the matcher of this filter- Returns:
- matcher
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getCssFilter
public java.lang.String getCssFilter()
Description copied from interface:SearchFilter
Get the CSS string used by CSS search time filtering.- Specified by:
getCssFilter
in interfaceSearchFilter
- Returns:
- css filter string
-
isCssFilterSupported
public boolean isCssFilterSupported()
Description copied from interface:SearchFilter
Does this filter support filtering at search time with CSS selector.- Specified by:
isCssFilterSupported
in interfaceSearchFilter
- Returns:
- true if CSS filtering is supported, else false
-
applyFilter
public java.util.Collection<FluentWebElement> applyFilter(java.util.Collection<FluentWebElement> elements)
Description copied from interface:SearchFilter
Apply the filter.- Specified by:
applyFilter
in interfaceSearchFilter
- Parameters:
elements
- input elements- Returns:
- filtered elements
-
-