public class ArgumentParser extends Object
Constructor and Description |
---|
ArgumentParser(List<String> tokenList)
Create a command line representation from an array of strings.
|
ArgumentParser(String commandline)
Create a command line representation from the string with a shell command
line.
|
ArgumentParser(String[] tokenArray)
Create a command line representation from an array of strings.
|
ArgumentParser(String command,
List<String> parameterList)
Create a command line representation from the command and an list of
parameters.
|
ArgumentParser(String command,
String[] parameterArray)
Create a command line representation from the command and an array of
parameters.
|
Modifier and Type | Method and Description |
---|---|
String |
getCommand()
Returns the command of the command line, assuming that the first entry is
always the command.
|
String |
getCommandLine(boolean fullEscape)
Convert all tokens in a full command line that can be executed in a
shell.
|
String |
getEscapedCommand(boolean fullEscalpe)
Returns the command of the command line, assuming that the first entry is
always the command.
|
String[] |
getParameterArray()
Returns a list of all arguments, assuming that the first entry is the
command name.
|
List<String> |
getParameterList()
Returns a list of all arguments, assuming that the first entry is the
command name.
|
int |
getSize()
Returns the total number of entries.
|
String[] |
getTokenArray()
Returns a List of all entries of the command line.
|
List<String> |
getTokenList()
Returns a List of all entries of the command line.
|
String |
toString()
Returns a representation of the command line for debug purposes.
|
public ArgumentParser(String commandline)
public ArgumentParser(String[] tokenArray)
public ArgumentParser(List<String> tokenList)
public ArgumentParser(String command, String[] parameterArray)
public String getCommandLine(boolean fullEscape)
fullEscape
- If every special character shall be escaped. If false, only
white spaces are escaped and the shell will interpret the
special chars. If true, then all special chars are quoted.public String[] getTokenArray()
public List<String> getTokenList()
public String getCommand()
public String getEscapedCommand(boolean fullEscalpe)
fullEscape
- If every special character shall be escaped. If false, only
white spaces are escaped and the shell will interpret the
special chars. If true, then all special chars are quoted.public String[] getParameterArray()
public List<String> getParameterList()
public int getSize()
Copyright (c) 2011 IBM Corporation and others. All Rights Reserved.