public class ShellImpl extends Object implements Shell
Shell
component.Constructor and Description |
---|
ShellImpl(EventManager events,
CommandExecutor executor,
Branding branding,
IO io,
Variables variables) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
Object |
execute(CharSequence line) |
Object |
execute(CharSequence command,
Object[] args) |
Object |
execute(Object... args) |
Branding |
getBranding() |
History |
getHistory() |
IO |
getIo() |
Variables |
getVariables() |
void |
installCompleters(jline.console.completer.Completer c1,
jline.console.completer.Completer c2) |
boolean |
isInteractive()
Check if the shell can be run interactively.
|
boolean |
isLoadInteractiveScripts() |
boolean |
isLoadProfileScripts() |
boolean |
isOpened() |
protected void |
loadInteractiveScripts() |
protected void |
loadProfileScripts() |
protected void |
loadScript(File file) |
protected void |
loadSharedScript(String fileName) |
protected void |
loadUserScript(String fileName) |
protected void |
renderGoodbyeMessage(IO io) |
protected void |
renderWelcomeMessage(IO io) |
void |
run(Object... args)
Run the shell interactively.
|
void |
setCompleters(jline.console.completer.Completer... completers) |
void |
setCompleters(List<jline.console.completer.Completer> completers) |
void |
setErrorHandler(ConsoleErrorHandler errorHandler) |
void |
setLoadInteractiveScripts(boolean enable) |
void |
setLoadProfileScripts(boolean enable) |
void |
setPrompt(ConsolePrompt prompt) |
@Inject public ShellImpl(EventManager events, CommandExecutor executor, Branding branding, IO io, Variables variables) throws IOException
IOException
public Branding getBranding()
getBranding
in interface Shell
public Variables getVariables()
getVariables
in interface Shell
public History getHistory()
getHistory
in interface Shell
@Inject public void setPrompt(ConsolePrompt prompt)
@Inject public void setErrorHandler(ConsoleErrorHandler errorHandler)
public void setCompleters(List<jline.console.completer.Completer> completers)
public void setCompleters(jline.console.completer.Completer... completers)
@Inject public void installCompleters(jline.console.completer.Completer c1, jline.console.completer.Completer c2)
public boolean isLoadProfileScripts()
public void setLoadProfileScripts(boolean enable)
public boolean isLoadInteractiveScripts()
public void setLoadInteractiveScripts(boolean enable)
public boolean isInteractive()
Shell
isInteractive
in interface Shell
public Object execute(CharSequence line) throws Exception
public Object execute(CharSequence command, Object[] args) throws Exception
public void run(Object... args) throws Exception
Shell
run
in interface Shell
args
- The initial commands to execute interactively.Exception
- Failed to execute commands.UnsupportedOperationException
- The shell does not support interactive execution.protected void renderWelcomeMessage(IO io)
protected void renderGoodbyeMessage(IO io)
Copyright © 2008-2012 Sonatype. All Rights Reserved.