Package com.aspectran.shell.command
Class CommandLineParser
- java.lang.Object
-
- com.aspectran.shell.command.CommandLineParser
-
public class CommandLineParser extends java.lang.Object
The Command Line Parser.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ParameterMap
extractParameters()
java.lang.String[]
getArgs()
Gets the command arguments.java.lang.String
getCommandName()
Gets the translet name.java.util.List<CommandLineRedirection>
getRedirectionList()
java.io.Writer[]
getRedirectionWriters(Console console)
MethodType
getRequestMethod()
Gets the request method.boolean
hasParameters()
boolean
isParseArgs()
static CommandLineParser
parse(java.lang.String commandLine)
Returns the command line parser.static CommandLineParser
parse(java.lang.String commandLine, boolean parseArgs)
static java.lang.String
serialize(java.util.List<CommandLineRedirection> redirectionList)
static java.lang.String[]
splitCommandLine(java.lang.String commandLine)
-
-
-
Method Detail
-
isParseArgs
public boolean isParseArgs()
-
getRequestMethod
public MethodType getRequestMethod()
Gets the request method.- Returns:
- the request method
-
getCommandName
public java.lang.String getCommandName()
Gets the translet name.- Returns:
- the translet name
-
getArgs
public java.lang.String[] getArgs()
Gets the command arguments.- Returns:
- the command arguments
-
hasParameters
public boolean hasParameters()
-
extractParameters
public ParameterMap extractParameters()
-
getRedirectionList
public java.util.List<CommandLineRedirection> getRedirectionList()
-
getRedirectionWriters
public java.io.Writer[] getRedirectionWriters(Console console) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException
- Throws:
java.io.FileNotFoundException
java.io.UnsupportedEncodingException
-
parse
public static CommandLineParser parse(java.lang.String commandLine)
Returns the command line parser.- Parameters:
commandLine
- the command line- Returns:
- the command line parser
-
parse
public static CommandLineParser parse(java.lang.String commandLine, boolean parseArgs)
-
serialize
public static java.lang.String serialize(java.util.List<CommandLineRedirection> redirectionList)
-
splitCommandLine
public static java.lang.String[] splitCommandLine(java.lang.String commandLine)
-
-