public final class Shell extends Object
get()
. parse args if no cmd attempt
to read from stdin a list of cmds or from a faile -f if cmd run it. A cmd line instance is parsing a single command.
parsed data is injected into the command and then the command is run. a cmd type is providing the info on how a
command is injected. top level params are: -h help -u username -p password -f batch file - batch from stdinModifier and Type | Field and Description |
---|---|
protected CommandRegistry |
activeRegistry |
protected CompositeValueAdapter |
adapter |
protected Map<String,CommandRegistry> |
cmds |
protected CompositeCompletorProvider |
completorProvider |
protected ShellConsole |
console |
protected Map<String,Object> |
ctx |
protected Map<Class<?>,Object> |
ctxObjects |
protected Map<Class<?>,ShellFeature> |
features |
protected List<ShellConfigurationListener> |
listeners |
protected LinkedHashMap<String,String> |
mainArgs |
protected Properties |
settings |
protected List<String> |
versions
A list with all version lines to be displayed when version command is executed.
|
protected List<ShellConfigurationListener> listeners
protected LinkedHashMap<String,String> mainArgs
protected CompositeCompletorProvider completorProvider
protected CompositeValueAdapter adapter
protected ShellConsole console
protected Map<String,CommandRegistry> cmds
protected CommandRegistry activeRegistry
protected Properties settings
protected Map<Class<?>,Object> ctxObjects
protected Map<Class<?>,ShellFeature> features
public static void reset()
public List<String> getVersions()
public void addConfigurationListener(ShellConfigurationListener listener)
public void removeConfigurationChangeListener(ShellConfigurationListener listener)
protected void loadSettings() throws IOException
IOException
public Properties getSettings()
public void setSetting(String name, String value)
public String getSetting(String key)
public String getSetting(String key, String defValue)
public boolean getBooleanSetting(String key, boolean defValue)
public File getConfigDir()
public File getSettingsFile()
public File getHistoryFile()
protected void loadFeatures()
protected String getDefaultNamespace()
public LinkedHashMap<String,String> getMainArguments()
public LinkedHashMap<String,String> collectArgs(String[] args)
protected ShellConsole createConsole()
public void addValueAdapter(ValueAdapter adapter)
public void removeValueAdapter(ValueAdapter adapter)
public void addCompletorProvider(CompletorProvider provider)
public <T> T getContextObject(Class<T> type)
public <T> void putContextObject(Class<T> type, T instance)
public <T> T removeContextObject(Class<T> type)
public CompletorProvider getCompletorProvider()
public void addRegistry(CommandRegistry reg)
public CommandRegistry removeRegistry(String key)
public CommandRegistry getRegistry(String name)
public CommandRegistry[] getRegistries()
public String[] getRegistryNames()
public CommandRegistry getActiveRegistry()
public CommandRegistry setActiveRegistry(String name)
name
- public ShellConsole getConsole()
public void setConsole(ShellConsole console)
public ValueAdapter getValueAdapter()
public Object getProperty(String key)
public Object getProperty(String key, Object defaultValue)
public void setProperty(String key, Object value)
public Map<String,Object> getProperties()
public void runBatch(List<String> lines) throws ShellException
ShellException
public void run(String cmdline) throws ShellException
ShellException
public void run(String... line) throws ShellException
ShellException
public void run(Runnable cmd) throws ShellException
ShellException
public Runnable newCommand(String cmdline) throws ShellException
ShellException
public Runnable newCommand(String... line) throws ShellException
ShellException
public void hello() throws IOException
IOException
public void bye()
public ShellFeature[] getFeatures()
public <T extends ShellFeature> T getFeature(Class<T> type)
public void addFeature(ShellFeature feature)
public jline.ANSIBuffer newANSIBuffer()
public void loadConfig() throws IOException
IOException
Copyright © 2018 Nuxeo. All rights reserved.