Class CssDeclarationValueTokenizer

java.lang.Object
com.itextpdf.styledxmlparser.css.parse.CssDeclarationValueTokenizer
Direct Known Subclasses:
CssDeclarationVarParser

public class CssDeclarationValueTokenizer extends Object
Tokenizer for CSS declaration values.
  • Field Details

    • src

      protected final String src
      The source string.
    • index

      protected int index
      The current index.
    • stringQuote

      protected char stringQuote
      The quote string, either "'" or "\"".
    • inString

      protected boolean inString
      Indicates if we're inside a string.
    • functionDepth

      protected int functionDepth
      The depth.
  • Constructor Details

    • CssDeclarationValueTokenizer

      public CssDeclarationValueTokenizer (String propertyValue)
      Creates a new CssDeclarationValueTokenizer instance.
      Parameters:
      propertyValue - the property value
  • Method Details

    • getNextValidToken

      public CssDeclarationValueTokenizer.Token getNextValidToken()
      Gets the next valid token.
      Returns:
      the next valid token
    • parseFunctionToken

      protected CssDeclarationValueTokenizer.Token parseFunctionToken (CssDeclarationValueTokenizer.Token token, int funcDepth)
      Parse internal function token to full function token, e.g.

      calc(calc( to calc(calc(50px + 5px) + 20px)

      Parameters:
      token - function token to expand
      funcDepth - function depth for resolving, e.g. if you want to resolve only nested function, not the whole declaration
      Returns:
      expanded function token
    • getNextToken

      protected CssDeclarationValueTokenizer.Token getNextToken()
      Gets the next token.
      Returns:
      the next token