Class QuotedStringTokenizer


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

      Fields 
      Modifier and Type Field Description
      protected static StringManager sm
      StringManager for internationalized messages.
    • Constructor Summary

      Constructors 
      Constructor Description
      QuotedStringTokenizer​(java.lang.String text)
      Creates a new tokenizer for the given text.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int countTokens()
      Returns the number of remaining tokens.
      boolean hasMoreTokens()
      Returns whether there are more tokens available.
      java.lang.String nextToken()
      Returns the next token from the input text.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • sm

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

      • QuotedStringTokenizer

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

      • hasMoreTokens

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

        public java.lang.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()