public class BaseShellCommand<CC extends BaseCommand> extends Object implements ShellCommand
| Modifier and Type | Field and Description |
|---|---|
private Class<CC> |
clazz
.
|
private CommandDescriptorImpl<CC> |
descriptor
.
|
| Constructor and Description |
|---|
BaseShellCommand(Class<CC> clazz) |
| Modifier and Type | Method and Description |
|---|---|
CompletionMatch |
complete(RuntimeContext context,
String line)
Provide completions for the specified arguments.
|
private CC |
createCommand() |
String |
describe(String line,
DescriptionFormat mode)
Returns a description of the command or null if none can be found.
|
CommandDescriptor<? extends BaseCommand> |
getDescriptor() |
private <P> CommandInvoker<Void,P> |
getInvoker(CommandInvoker<CC,?> invoker,
CC instance,
Class<P> _producedType,
Resolver resolver) |
private <C,P,PC extends PipeCommand<C,P>> |
getPipeCommandInvoker(CommandInvoker<CC,PC> invoker,
CC instance,
Resolver resolver) |
CommandInvoker<?,?> |
resolveInvoker(InvocationMatch<CC> 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.
|
private CommandInvoker<?,?> |
resolveInvoker2(InvocationMatch<CC> match) |
private final Class<CC extends BaseCommand> clazz
private final CommandDescriptorImpl<CC extends BaseCommand> descriptor
public BaseShellCommand(Class<CC> clazz)
public CommandDescriptor<? extends BaseCommand> getDescriptor()
public final CompletionMatch complete(RuntimeContext context, String line) throws CommandCreationException
ShellCommandcomplete in interface ShellCommandcontext - the command contextline - the original command line argumentsCommandCreationExceptionpublic final String describe(String line, DescriptionFormat mode)
ShellCommanddescribe in interface ShellCommandline - the usage linemode - the description modepublic CommandInvoker<?,?> resolveInvoker(String name, Map<String,?> options, List<?> args) throws CommandCreationException
ShellCommandresolveInvoker in interface ShellCommandname - the command name, might be nulloptions - the optionsargs - the argumentsCommandCreationExceptionpublic CommandInvoker<?,?> resolveInvoker(String line) throws CommandCreationException
ShellCommandresolveInvoker in interface ShellCommandline - the command line argumentsCommandCreationExceptionpublic final CommandInvoker<?,?> resolveInvoker(InvocationMatch<CC> match) throws CommandCreationException
CommandCreationExceptionprivate CommandInvoker<?,?> resolveInvoker2(InvocationMatch<CC> match) throws CommandCreationException
CommandCreationExceptionprivate CC createCommand() throws CommandCreationException
CommandCreationExceptionprivate <C,P,PC extends PipeCommand<C,P>> CommandInvoker<C,P> getPipeCommandInvoker(CommandInvoker<CC,PC> invoker, CC instance, Resolver resolver)
private <P> CommandInvoker<Void,P> getInvoker(CommandInvoker<CC,?> invoker, CC instance, Class<P> _producedType, Resolver resolver)
Copyright © 2013 eXo Platform SAS. All Rights Reserved.