Class 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 Detail

      • AttrSelector

        public AttrSelector​(@Nonnull
                            String namespacePrefix,
                            @Nonnull
                            String attrName,
                            @Nonnull
                            String matchOperator,
                            @Nonnull
                            String value)
        Parameters:
        namespacePrefix - namespace prefix
        attrName - attribute name
        matchOperator - 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

      • accept

        public void accept​(@Nonnull
                           SelectorVisitor visitor)
        visits a selector
        Specified by:
        accept in class Selector
        Parameters:
        visitor - a SelectorVisitor instance
      • getTokenType

        public TokenType getTokenType()
        get token type
        Specified by:
        getTokenType in class Token
        Returns:
        the token type