Class CssTokenUtil


  • public final class CssTokenUtil
    extends Object
    General utility methods to map token types to token kinds from cssparser library.
    Author:
    nhant01, GeorgeLuo
    • Method Detail

      • getTokenType

        public static TokenType getTokenType​(@Nonnull
                                             com.steadystate.css.parser.Token token)
        Overloaded method to return a TokenType, given a CSS3 Token
        Parameters:
        token - of CSS3 Token type
        Returns:
        a TokenType enum value useful to Canonicalizer
      • copyPosTo

        public static Token copyPosTo​(@Nonnull
                                      com.steadystate.css.parser.Token css3Token,
                                      @Nonnull
                                      Token other)
        Copies the line / col values of |this| to |other|.
        Parameters:
        css3Token - is the token to copy location from.
        other - is the value receiving the location values.
        Returns:
        other
      • getMirror

        public static String getMirror​(@Nonnull
                                       com.steadystate.css.parser.Token token)
        Returns a mirroring character for a token with a reflective match
        Parameters:
        token - of interest.
        Returns:
        the mirroring character