|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.crsh.shell.impl.command.spi.Command<T>
public abstract class Command<T>
A command as seen by the shell.
| Constructor Summary | |
|---|---|
Command()
|
|
| Method Summary | |
|---|---|
org.crsh.cli.impl.completion.CompletionMatch |
complete(RuntimeContext context,
String line)
Provide completions for the specified arguments. |
String |
describe(org.crsh.cli.impl.invocation.InvocationMatch<T> match,
Format format)
|
String |
describe(String line,
Format format)
Returns a description of the command or null if none can be found. |
protected abstract Completer |
getCompleter(RuntimeContext context)
Returns a completer for this command. |
abstract CommandDescriptor<T> |
getDescriptor()
Returns the command descriptor. |
protected abstract CommandMatch<?,?> |
resolve(org.crsh.cli.impl.invocation.InvocationMatch<T> match)
Resolve the real match for a specified invocation match. |
CommandMatch<?,?> |
resolveCommand(Map<String,?> options,
String subordinate,
Map<String,?> subordinateOptions,
List<?> arguments)
Provides an invoker for the command line specified in a detyped manner. |
CommandMatch<?,?> |
resolveCommand(String line)
|
CommandInvoker<?,?> |
resolveInvoker(String line)
Provides an invoker for the command line specified as a command line to parse. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Command()
| Method Detail |
|---|
public abstract CommandDescriptor<T> getDescriptor()
protected abstract Completer getCompleter(RuntimeContext context)
throws CommandException
context - the related runtime context
CommandException - anything that would prevent completion to happenprotected abstract CommandMatch<?,?> resolve(org.crsh.cli.impl.invocation.InvocationMatch<T> match)
match - the match
public final String describe(org.crsh.cli.impl.invocation.InvocationMatch<T> match,
Format format)
public final org.crsh.cli.impl.completion.CompletionMatch complete(RuntimeContext context,
String line)
throws CommandException
context - the command contextline - the original command line arguments
CommandException
public final String describe(String line,
Format format)
throws CommandException
line - the usage lineformat - the description format
CommandException
public final CommandInvoker<?,?> resolveInvoker(String line)
throws CommandException
line - the command line arguments
CommandException
public final CommandMatch<?,?> resolveCommand(String line)
throws CommandException
CommandException
public final CommandMatch<?,?> resolveCommand(Map<String,?> options,
String subordinate,
Map<String,?> subordinateOptions,
List<?> arguments)
throws CommandException
options - the base optionssubordinate - the subordinate command name, might nullsubordinateOptions - the subordinate optionsarguments - arguments
CommandException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||