|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.crsh.command.AbstractCommand
org.crsh.command.BaseCommand
public abstract class BaseCommand
| Field Summary | |
|---|---|
private CommandDescriptorImpl<?> |
descriptor
. |
private Logger |
log
. |
protected String |
unmatched
The unmatched text, only valid during an invocation. |
| Fields inherited from class org.crsh.command.AbstractCommand |
|---|
context, out |
| Constructor Summary | |
|---|---|
protected |
BaseCommand()
|
| Method Summary | |
|---|---|
CompletionMatch |
complete(RuntimeContext context,
String line)
Provide completions for the specified arguments. |
String |
describe(String line,
DescriptionFormat mode)
Returns a description of the command or null if none can be found. |
void |
execute(String s)
|
CommandDescriptor<?> |
getDescriptor()
Returns the command descriptor. |
String |
getUnmatched()
|
protected String |
readLine(String msg)
|
protected String |
readLine(String msg,
boolean echo)
|
CommandInvoker<?,?> |
resolveInvoker(InvocationMatch<BaseCommand> match)
|
CommandInvoker<?,?> |
resolveInvoker(String line)
Provides an invoker for the command line specified as a command line to parse. |
CommandInvoker<?,?> |
resolveInvoker(String name,
Map<String,?> options,
List<?> args)
Provides an invoker for the command line specified under the form of a command, options and arguments. |
ScriptException |
toScript(Throwable cause)
|
| Methods inherited from class org.crsh.command.AbstractCommand |
|---|
peekContext, popContext, pushContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final Logger log
private final CommandDescriptorImpl<?> descriptor
protected String unmatched
| Constructor Detail |
|---|
protected BaseCommand()
throws IntrospectionException
IntrospectionException| Method Detail |
|---|
public CommandDescriptor<?> getDescriptor()
protected final String readLine(String msg)
protected final String readLine(String msg,
boolean echo)
public final String getUnmatched()
public final CompletionMatch complete(RuntimeContext context,
String line)
ShellCommand
complete in interface ShellCommandcontext - the command contextline - the original command line arguments
public final String describe(String line,
DescriptionFormat mode)
ShellCommand
describe in interface ShellCommandline - the usage linemode - the description mode
public CommandInvoker<?,?> resolveInvoker(String name,
Map<String,?> options,
List<?> args)
ShellCommand
resolveInvoker in interface ShellCommandname - the command name, might be nulloptions - the optionsargs - the arguments
public ScriptException toScript(Throwable cause)
public CommandInvoker<?,?> resolveInvoker(String line)
ShellCommand
resolveInvoker in interface ShellCommandline - the command line arguments
public final void execute(String s)
throws ScriptException,
IOException
ScriptException
IOExceptionpublic final CommandInvoker<?,?> resolveInvoker(InvocationMatch<BaseCommand> match)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||