Class QuotedStringTokenizer

java.lang.Object
org.apache.catalina.valves.rewrite.QuotedStringTokenizer

public class QuotedStringTokenizer extends Object
Tokenizer that splits input text into tokens, respecting quoted strings (enclosed in double quotes), escape sequences, and comment lines (starting with #).
  • Field Details

    • sm

      protected static final StringManager sm
      StringManager for internationalized messages.
  • Constructor Details

    • QuotedStringTokenizer

      public QuotedStringTokenizer(String text)
      Creates a new tokenizer for the given text.
      Parameters:
      text - the text to tokenize, or null for an empty token list
  • Method Details

    • hasMoreTokens

      public boolean hasMoreTokens()
      Returns whether there are more tokens available.
      Returns:
      true if there are more tokens, false otherwise
    • nextToken

      public String nextToken()
      Returns the next token from the input text.
      Returns:
      the next token
    • countTokens

      public int countTokens()
      Returns the number of remaining tokens.
      Returns:
      the number of tokens that have not yet been returned by nextToken()