public abstract class AbstractCompleterService extends Object implements CompleterService
CompleterService
implementation which adds facilities for easy
dependency tracking.
Default (empty) implementations are provided for getOptionCompleters()
and
getSubcommandCompleters()
since not all implementations have reason to implement
both of these.
May be useful for CompleterServices which require access to a resource like a DAO to perform
their duties. In this situation, consider also passing the DependencyServices instance
through to a CompletionFinder
, which can decide to provide no results if the
dependencies are unavailable, or use the dependency resources to gather results.Modifier and Type | Field and Description |
---|---|
protected DependencyServices |
dependencyServices |
Constructor and Description |
---|
AbstractCompleterService() |
Modifier and Type | Method and Description |
---|---|
Map<CliCommandOption,? extends TabCompleter> |
getOptionCompleters()
Provides the mapping of options to corresponding completers.
|
Map<String,Map<CliCommandOption,? extends TabCompleter>> |
getSubcommandCompleters()
Provides the mapping of subcommand options to corresponding completers.
|
protected <T> void |
setService(Class<T> klazz,
T t) |
protected void |
unsetService(Class<?> klazz) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCommands
protected final DependencyServices dependencyServices
protected <T> void setService(Class<T> klazz, T t)
protected void unsetService(Class<?> klazz)
public Map<CliCommandOption,? extends TabCompleter> getOptionCompleters()
CompleterService
getOptionCompleters
in interface CompleterService
public Map<String,Map<CliCommandOption,? extends TabCompleter>> getSubcommandCompleters()
CompleterService
CompleterService.getOptionCompleters()
.getSubcommandCompleters
in interface CompleterService
Copyright © 2017. All rights reserved.