public abstract class Main
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
console
Console mode.
|
Context |
context
Database context.
|
protected boolean |
newline
Trailing newline.
|
protected java.io.OutputStream |
out
Output file for queries.
|
protected Session |
session
Session.
|
protected boolean |
verbose
Verbose mode.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Main(java.lang.String[] args)
Constructor.
|
protected |
Main(java.lang.String[] args,
Context ctx)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
console()
Launches the console mode, which reads and executes user input.
|
protected void |
execute(Command cmd,
boolean info)
Executes the specified command and optionally prints some information.
|
protected boolean |
execute(java.lang.String in)
Parses and executes the input string.
|
protected abstract void |
parseArguments(java.lang.String[] args)
Parses the command-line arguments, specified by the user.
|
protected void |
quit()
Quits the console mode.
|
protected abstract Session |
session()
Returns the session.
|
public final Context context
protected java.io.OutputStream out
protected boolean console
false during execution.protected Session session
protected boolean verbose
protected boolean newline
protected Main(java.lang.String[] args)
throws java.io.IOException
args - command-line argumentsjava.io.IOException - I/O exceptionprotected Main(java.lang.String[] args,
Context ctx)
throws java.io.IOException
args - command-line argumentsctx - database context, or nulljava.io.IOException - I/O exceptionprotected final void console()
protected void quit()
throws java.io.IOException
java.io.IOException - I/O exceptionprotected final boolean execute(java.lang.String in)
throws java.io.IOException
in - input commandsfalse if the exit command was sentjava.io.IOException - database exceptionprotected final void execute(Command cmd, boolean info) throws java.io.IOException
cmd - command to be runinfo - verbose flagjava.io.IOException - I/O exceptionprotected abstract Session session() throws java.io.IOException
java.io.IOException - I/O exceptionprotected abstract void parseArguments(java.lang.String[] args)
throws java.io.IOException
args - command-line argumentsjava.io.IOException - I/O exception