Class TypeSelector

  • All Implemented Interfaces:
    Serializable

    public class TypeSelector
    extends Selector
    This node models type selectors and universal selectors. http://www.w3.org/TR/css3-selectors/#type-selectors http://www.w3.org/TR/css3-selectors/#universal-selector
    Author:
    nhant01, GeorgeLuo
    See Also:
    Serialized Form
    • Constructor Detail

      • TypeSelector

        public TypeSelector​(String namespacePrefix,
                            String elementName)
        Choices for namespacePrefix: - 'a specific namespace prefix' means 'just that specific namespace'. - '' means 'without a namespace' - '*' means 'any namespace including without a namespace' - null means the default namespace if one is declared, and '*' otherwise. The universal selector is covered by setting the elementName to '*'.
        Parameters:
        namespacePrefix - a namespace prefix
        elementName - element name
    • Method Detail

      • accept

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

        public TokenType getTokenType()
        Getter for token type returns stylesheet.
        Specified by:
        getTokenType in class Token
        Returns:
        TokenType.STYLESHEET
      • toString

        public String toString()
        Serializes the selector to a string (in this case CSS syntax that could be used to recreate it).
        Overrides:
        toString in class Token
        Returns:
        a string