| java.lang.Object edu.rice.cs.util.ArgumentTokenizer
ArgumentTokenizer | abstract public class ArgumentTokenizer (Code) | | Utility class which can tokenize a String into a list of String arguments,
with behavior similar to parsing command line arguments to a program.
Quoted Strings are treated as single arguments, and escaped characters
are translated so that the tokenized arguments have the same meaning.
Since all methods are static, the class is declared abstract to prevent
instantiation.
version: $Id: ArgumentTokenizer.java 4255 2007-08-28 19:17:37Z mgricken $ |
Method Summary | |
protected static String | _escapeQuotesAndBackslashes(String s) Inserts backslashes before any occurrences of a backslash or
quote in the given string. | public static List<String> | tokenize(String arguments) Tokenizes the given String into String tokens
Parameters: arguments - A String containing one or more command-line style arguments to be tokenized. | public static List<String> | tokenize(String arguments, boolean stringify) Tokenizes the given String into String tokens. |
_escapeQuotesAndBackslashes | protected static String _escapeQuotesAndBackslashes(String s)(Code) | | Inserts backslashes before any occurrences of a backslash or
quote in the given string. Also converts any special characters
appropriately.
|
tokenize | public static List<String> tokenize(String arguments)(Code) | | Tokenizes the given String into String tokens
Parameters: arguments - A String containing one or more command-line style arguments to be tokenized. A list of parsed and properly escaped arguments. |
tokenize | public static List<String> tokenize(String arguments, boolean stringify)(Code) | | Tokenizes the given String into String tokens.
Parameters: arguments - A String containing one or more command-line style arguments to be tokenized. Parameters: stringify - whether or not to include escape special characters A list of parsed and properly escaped arguments. |
|
|