Package org.glassfish.common.util.admin
Class ParamTokenizer
java.lang.Object
org.glassfish.common.util.admin.ParamTokenizer
Separate parameters to admin commands into tokens.
Mostly used for parameters that take a list of values
separated by colons.
- Author:
- Bill Shannon
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected charstatic final LocalStringManagerImplprotected intprotected Stringprotected StringBuilder -
Constructor Summary
ConstructorsConstructorDescriptionParamTokenizer(String str, char delimiter) Construct a tokenizer for the specified string. -
Method Summary
-
Field Details
-
currentPosition
protected int currentPosition -
maxPosition
protected int maxPosition -
str
-
delimiter
protected char delimiter -
token
-
localStrings
-
-
Constructor Details
-
ParamTokenizer
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:
trueif there are more tokens available from this tokenizer's string;falseotherwise.
-
nextToken
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
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
Return the next token starting at the current position.- Throws:
IllegalArgumentException
-