[Groovy] Class CommandSupport
- org.apache.groovy.groovysh.CommandSupport
- All Implemented Interfaces and Traits:
- CommandLine.Command
abstract class CommandSupport extends Object implements CommandLine.Command
Support for Command instances.
Field Summary
| Modifiers | Name | Description | 
|---|---|---|
| protected static String | NEWLINE | |
| protected IO | io | The I/O container for the command to spit stuff out. | 
| protected Logger | log | Instance logger for the command, initialized late to include the command name. | 
| protected MessageSource | messages | i18n message source for the command. | 
| protected CommandRegistry | registry | Provides the command instance with the registry, for aliasing support. | 
| protected Groovysh | shell | The owning shell. | 
Properties Summary
| Type | Name and description | 
|---|---|
| List | aliasesStandard aliases for the command. | 
| boolean | hiddenFlag to indicate if the command should be hidden or not. | 
| String | nameThe name of the command. | 
| String | shortcutThe shortcut switch | 
Constructor Summary
| Constructor and description | 
|---|
| protected CommandSupport
                                (Groovysh shell, String name, String shortcut) | 
Methods Summary
| Type Params | Return Type | Name and description | 
|---|---|---|
| protected void | alias(String name, String shortcut) | |
| protected void | assertNoArguments(List<String> args) | |
| protected List<Completer> | createCompleters()Override to provide custom completion semantics for the command. | |
| protected void | fail(String msg) | |
| protected void | fail(String msg, Throwable cause) | |
| List | getAliases() | |
| protected Binding | getBinding() | |
| protected List<String> | getBuffer() | |
| protected BufferManager | getBuffers() | |
| protected GroovyClassLoader | getClassLoader() | |
| Completer | getCompleter()Setup the Completer for the command. | |
| String | getDescription() | |
| String | getHelp() | |
| boolean | getHidden() | |
| protected FileHistory | getHistory() | |
| protected List<String> | getImports() | |
| String | getName() | |
| String | getShortcut() | |
| String | getUsage() | |
| protected Map | getVariables() | 
Inherited Methods Summary
| Methods inherited from class | Name | 
|---|---|
| class Object | wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll | 
Field Detail
protected static final String NEWLINE
protected final IO io
The I/O container for the command to spit stuff out.
protected final Logger log
Instance logger for the command, initialized late to include the command name.
protected final MessageSource messages
i18n message source for the command.
protected CommandRegistry registry
Provides the command instance with the registry, for aliasing support.
protected final Groovysh shell
The owning shell.
Property Detail
final List aliases
Standard aliases for the command.
boolean hidden
Flag to indicate if the command should be hidden or not.
final String name
The name of the command.
final String shortcut
The shortcut switch
Constructor Detail
protected CommandSupport(Groovysh shell, String name, String shortcut)
Method Detail
protected void alias(String name, String shortcut)
protected void assertNoArguments(List<String> args)
protected List<Completer> createCompleters()
Override to provide custom completion semantics for the command.
protected void fail(String msg)
protected void fail(String msg, Throwable cause)
@Override List getAliases()
protected Binding getBinding()
protected List<String> getBuffer()
protected BufferManager getBuffers()
protected GroovyClassLoader getClassLoader()
@Override Completer getCompleter()
Setup the Completer for the command.
@Override String getDescription()
@Override String getHelp()
@Override boolean getHidden()
protected FileHistory getHistory()
protected List<String> getImports()
@Override String getName()
@Override String getShortcut()
@Override String getUsage()
protected Map getVariables()
    © 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
    https://docs.groovy-lang.org/3.0.7/html/gapi/org/apache/groovy/groovysh/CommandSupport.html