Package dev.amp.validator.selector
Class AttrSelector
- java.lang.Object
-
- com.steadystate.css.parser.Token
-
- dev.amp.validator.css.Token
-
- dev.amp.validator.selector.Selector
-
- dev.amp.validator.selector.AttrSelector
-
- All Implemented Interfaces:
Serializable
public class AttrSelector extends Selector
An attribute selector matches document nodes based on their attributes. http://www.w3.org/TR/css3-selectors/#attribute-selectors Typically written as '[foo=bar]'.- Author:
- nhant01, GeorgeLuo
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AttrSelector(String namespacePrefix, String attrName, String matchOperator, String value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(SelectorVisitor visitor)visits a selectorvoidforEachChild(Consumer<Selector> selector)TokenTypegetTokenType()get token type
-
-
-
Constructor Detail
-
AttrSelector
public AttrSelector(@Nonnull String namespacePrefix, @Nonnull String attrName, @Nonnull String matchOperator, @Nonnull String value)- Parameters:
namespacePrefix- namespace prefixattrName- attribute namematchOperator- is either the string representation of the match operator (e.g., '=' or '~=') or '', in which case the attribute selector is a check for the presence of the attribute.value- is the value to apply the match operator against, or if matchOperator is '', then this must be empty as well.
-
-
Method Detail
-
forEachChild
public void forEachChild(Consumer<Selector> selector)
- Specified by:
forEachChildin classSelector- Parameters:
selector- selector function
-
accept
public void accept(@Nonnull SelectorVisitor visitor)visits a selector
-
getTokenType
public TokenType getTokenType()
get token type- Specified by:
getTokenTypein classToken- Returns:
- the token type
-
-