org.sonatype.gshell.shell
Class ShellImpl
java.lang.Object
org.sonatype.gshell.shell.ShellImpl
- All Implemented Interfaces:
- Shell
public class ShellImpl
- extends Object
- implements Shell
The default Shell component.
- Since:
- 2.0
- Author:
- Jason Dillon
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ShellImpl
@Inject
public ShellImpl(EventManager events,
CommandExecutor executor,
Branding branding,
IO io,
Variables variables)
throws IOException
- Throws:
IOException
getBranding
public Branding getBranding()
- Specified by:
getBranding in interface Shell
getIo
public IO getIo()
- Specified by:
getIo in interface Shell
getVariables
public Variables getVariables()
- Specified by:
getVariables in interface Shell
getHistory
public History getHistory()
- Specified by:
getHistory in interface Shell
setPrompt
@Inject
public void setPrompt(ConsolePrompt prompt)
setErrorHandler
@Inject
public void setErrorHandler(ConsoleErrorHandler errorHandler)
setCompleters
public void setCompleters(List<jline.console.completer.Completer> completers)
setCompleters
public void setCompleters(jline.console.completer.Completer... completers)
installCompleters
@Inject
public void installCompleters(jline.console.completer.Completer c1,
jline.console.completer.Completer c2)
isLoadProfileScripts
public boolean isLoadProfileScripts()
setLoadProfileScripts
public void setLoadProfileScripts(boolean enable)
isLoadInteractiveScripts
public boolean isLoadInteractiveScripts()
setLoadInteractiveScripts
public void setLoadInteractiveScripts(boolean enable)
isOpened
public boolean isOpened()
- Specified by:
isOpened in interface Shell
close
public void close()
- Specified by:
close in interface Shell
isInteractive
public boolean isInteractive()
- Description copied from interface:
Shell
- Check if the shell can be run interactively.
- Specified by:
isInteractive in interface Shell
- Returns:
- True if the shell is interactive.
execute
public Object execute(CharSequence line)
throws Exception
- Specified by:
execute in interface Shell
- Throws:
Exception
execute
public Object execute(CharSequence command,
Object[] args)
throws Exception
- Specified by:
execute in interface Shell
- Throws:
Exception
execute
public Object execute(Object... args)
throws Exception
- Specified by:
execute in interface Shell
- Throws:
Exception
run
public void run(Object... args)
throws Exception
- Description copied from interface:
Shell
- Run the shell interactively.
- Specified by:
run in interface Shell
- Parameters:
args - The initial commands to execute interactively.
- Throws:
Exception - Failed to execute commands.
UnsupportedOperationException - The shell does not support interactive execution.
renderWelcomeMessage
protected void renderWelcomeMessage(IO io)
renderGoodbyeMessage
protected void renderGoodbyeMessage(IO io)
loadProfileScripts
protected void loadProfileScripts()
throws Exception
- Throws:
Exception
loadInteractiveScripts
protected void loadInteractiveScripts()
throws Exception
- Throws:
Exception
loadScript
protected void loadScript(File file)
throws Exception
- Throws:
Exception
loadUserScript
protected void loadUserScript(String fileName)
throws Exception
- Throws:
Exception
loadSharedScript
protected void loadSharedScript(String fileName)
throws Exception
- Throws:
Exception
Copyright © 2008-2011 Sonatype. All Rights Reserved.