public abstract class CommandRegistry extends Object
Modifier and Type | Field and Description |
---|---|
protected Map<String,CommandType> |
cmds |
protected String |
name |
protected CommandRegistry |
parent |
Constructor and Description |
---|
CommandRegistry(CommandRegistry parent,
String name) |
Modifier and Type | Method and Description |
---|---|
void |
addAnnotatedCommand(Class<? extends Runnable> clazz) |
void |
addCommandType(CommandType type) |
void |
autorun(Shell shell)
Override this to automatically run some commands at startup if needed.
|
void |
clear() |
protected void |
collectCommandTypesByNamespace(Map<String,Set<CommandType>> map) |
String[] |
getCommandNames()
Get sorted command names including aliases
|
Set<String> |
getCommandNameSet() |
CommandType |
getCommandType(String name) |
CommandType[] |
getCommandTypes() |
Map<String,Set<CommandType>> |
getCommandTypesByNamespace() |
Set<CommandType> |
getCommandTypeSet() |
abstract String |
getDescription() |
CommandType[] |
getLocalCommandTypes() |
String |
getName() |
CommandRegistry |
getParent() |
String |
getPrompt(Shell shell)
Override this to provide a custom prompt for your command namespace
|
abstract String |
getTitle() |
protected CommandRegistry parent
protected Map<String,CommandType> cmds
public CommandRegistry(CommandRegistry parent, String name)
public abstract String getDescription()
public CommandRegistry getParent()
public void addCommandType(CommandType type)
public void addAnnotatedCommand(Class<? extends Runnable> clazz)
public CommandType getCommandType(String name)
public Set<CommandType> getCommandTypeSet()
public CommandType[] getCommandTypes()
public CommandType[] getLocalCommandTypes()
protected void collectCommandTypesByNamespace(Map<String,Set<CommandType>> map)
public Map<String,Set<CommandType>> getCommandTypesByNamespace()
public Set<String> getCommandNameSet()
public String[] getCommandNames()
public void clear()
public String getPrompt(Shell shell)
shell
- public void autorun(Shell shell)
Copyright © 2018 Nuxeo. All rights reserved.