Class ParamTokenizer

java.lang.Object
org.glassfish.common.util.admin.ParamTokenizer

public class ParamTokenizer extends Object
Separate parameters to admin commands into tokens. Mostly used for parameters that take a list of values separated by colons.
Author:
Bill Shannon
  • Field Details

    • currentPosition

      protected int currentPosition
    • maxPosition

      protected int maxPosition
    • str

      protected String str
    • delimiter

      protected char delimiter
    • token

      protected StringBuilder token
    • localStrings

      public static final LocalStringManagerImpl localStrings
  • Constructor Details

    • ParamTokenizer

      public ParamTokenizer(String str, char delimiter)
      Construct a tokenizer for the specified string.
      Parameters:
      str - a string to be parsed.
  • Method Details

    • hasMoreTokens

      public boolean hasMoreTokens()
      Test if there are more tokens available from this tokenizer's string.
      Returns:
      true if there are more tokens available from this tokenizer's string; false otherwise.
    • nextToken

      public String nextToken() throws NoSuchElementException
      Return the next token from this tokenizer.
      Returns:
      the next token from this tokenizer.
      Throws:
      NoSuchElementException - if there are no more tokens in this tokenizer's string.
    • nextTokenKeepEscapes

      public String nextTokenKeepEscapes() throws NoSuchElementException
      Return the next token from this tokenizer. Keep escapes and quotes intact.
      Returns:
      the next token from this tokenizer.
      Throws:
      NoSuchElementException - if there are no more tokens in this tokenizer's string.
    • scanToken

      protected String scanToken(boolean keep) throws IllegalArgumentException
      Return the next token starting at the current position.
      Throws:
      IllegalArgumentException