|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.objectweb.cjdbc.console.text.module.AbstractConsoleModule
This class defines a AbstractConsoleModule
Nested Class Summary | |
(package private) class |
AbstractConsoleModule.CommandDelimiter
This class defines a CommandDelimiter used to delimit a command from user input |
Field Summary | |
(package private) java.util.TreeSet |
commands
|
(package private) Console |
console
|
protected jline.Completor |
consoleCompletor
|
(package private) java.util.LinkedList |
history
|
private static int |
HISTORY_MAX
|
(package private) boolean |
quit
|
Constructor Summary | |
AbstractConsoleModule(Console console)
Creates a new AbstractConsoleModule.java object |
Method Summary | |
ConsoleCommand |
findConsoleCommand(java.lang.String commandLine,
java.util.Hashtable hashCommands)
Find the ConsoleCommand based on the name of the command
from the commandLine in the hashCommands .
|
java.util.TreeSet |
getCommands()
Get all the commands for this module |
jline.Completor |
getCompletor()
Returns the console completor to use for this module. |
Console |
getConsole()
Get access to the console |
abstract java.lang.String |
getDescriptionString()
Text description of this module |
java.util.Hashtable |
getHashCommands()
Get the list of commands as strings for this module |
java.util.LinkedList |
getHistory()
Returns the history value. |
abstract java.lang.String |
getPromptString()
Get the prompt string for this module |
void |
handleCommandLine(java.lang.String commandLine,
java.util.Hashtable hashCommands)
Handle module command |
void |
handlePrompt()
Handle a serie of commands |
void |
help()
Display help for this module |
protected abstract void |
loadCommands()
Loads the commands for this module |
protected void |
loadCompletor()
Loads the commands for this module |
protected void |
loadHistory()
Load History from java Preferences |
abstract void |
login(java.lang.String[] params)
Handles login in this module |
void |
manageHistory(java.lang.String command)
Add the command to the history. |
void |
quit()
Quit this module |
protected void |
reloadCompletor()
Reload the completor associated with this module. |
protected void |
storeHistory()
Strore History to java Preferences |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final int HISTORY_MAX
Console console
java.util.TreeSet commands
boolean quit
java.util.LinkedList history
protected jline.Completor consoleCompletor
Constructor Detail |
public AbstractConsoleModule(Console console)
AbstractConsoleModule.java
object
console
- to refer fromMethod Detail |
protected abstract void loadCommands()
protected void loadCompletor()
protected void reloadCompletor()
public abstract java.lang.String getDescriptionString()
String
description to displaypublic void help()
public void quit()
protected void loadHistory()
protected void storeHistory()
public java.util.TreeSet getCommands()
TreeSet
of commands (commandName|commandObject)public abstract java.lang.String getPromptString()
String
to place before promptpublic void handlePrompt()
public final java.util.Hashtable getHashCommands()
Hashtable
list of String
objectspublic final void handleCommandLine(java.lang.String commandLine, java.util.Hashtable hashCommands) throws java.lang.Exception
commandLine
- the command line to handlehashCommands
- the list of commands available for this module
java.lang.Exception
- if fails *public ConsoleCommand findConsoleCommand(java.lang.String commandLine, java.util.Hashtable hashCommands)
ConsoleCommand
based on the name of the command
from the commandLine
in the hashCommands
.
If more than one ConsoleCommand
's command name start the
same way, return the ConsoleCommand
with the longest one.
commandLine
- the command line to handlehashCommands
- the list of commands available for this module
ConsoleCommand
corresponding to the name of the
command from the commandLine
or null
if there is no matchingpublic final void manageHistory(java.lang.String command)
command
- taken from the command linepublic abstract void login(java.lang.String[] params) throws java.lang.Exception
params
- parameters to use to login in this module
java.lang.Exception
- if failspublic Console getConsole()
Console
instancepublic java.util.LinkedList getHistory()
public jline.Completor getCompletor()
Completor
object.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |