public class ArgumentParser
extends java.lang.Object
Constructor and Description |
---|
ArgumentParser(java.util.List<java.lang.String> tokenList)
Create a command line representation from an array of strings.
|
ArgumentParser(java.lang.String commandline)
Create a command line representation from the string with a shell command
line.
|
ArgumentParser(java.lang.String[] tokenArray)
Create a command line representation from an array of strings.
|
ArgumentParser(java.lang.String command,
java.util.List<java.lang.String> parameterList)
Create a command line representation from the command and an list of
parameters.
|
ArgumentParser(java.lang.String command,
java.lang.String[] parameterArray)
Create a command line representation from the command and an array of
parameters.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCommand()
Returns the command of the command line, assuming that the first entry is
always the command.
|
java.lang.String |
getCommandLine(boolean fullEscape)
Convert all tokens in a full command line that can be executed in a
shell.
|
java.lang.String |
getEscapedCommand(boolean fullEscalpe)
Returns the command of the command line, assuming that the first entry is
always the command.
|
java.lang.String[] |
getParameterArray()
Returns a list of all arguments, assuming that the first entry is the
command name.
|
java.util.List<java.lang.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.
|
java.lang.String[] |
getTokenArray()
Returns a List of all entries of the command line.
|
java.util.List<java.lang.String> |
getTokenList()
Returns a List of all entries of the command line.
|
java.lang.String |
toString()
Returns a representation of the command line for debug purposes.
|
public ArgumentParser(java.util.List<java.lang.String> tokenList)
public ArgumentParser(java.lang.String commandline)
public ArgumentParser(java.lang.String[] tokenArray)
public ArgumentParser(java.lang.String command, java.util.List<java.lang.String> parameterList)
public ArgumentParser(java.lang.String command, java.lang.String[] parameterArray)
public java.lang.String getCommand()
public java.lang.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 java.lang.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 java.lang.String[] getParameterArray()
public java.util.List<java.lang.String> getParameterList()
public int getSize()
public java.lang.String[] getTokenArray()
public java.util.List<java.lang.String> getTokenList()
public java.lang.String toString()
toString
in class java.lang.Object