Package org.basex.core
Class CLI
java.lang.Object
org.basex.util.Main
org.basex.core.CLI
- Direct Known Subclasses:
BaseX,BaseXServer
This is the abstract main class for the starter classes.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidExecutes the specified command and optionally prints some information.protected final booleanexecute(CommandParser parser) Execute the commands from the given command parser.protected final booleanParses and executes the input string.Returns the base URI and the query string for the specified input.protected booleanlocal()Indicates if this is a local client.protected final Sessionsession()Returns the session.
-
Field Details
-
context
Database context. -
commands
Cached initial commands. -
out
Output file for queries. -
verbose
protected boolean verboseVerbose mode.
-
-
Constructor Details
-
CLI
Constructor, assigning the specified context.- Parameters:
args- command-line argumentsctx- database context (ifnull, must be assigned later on)- Throws:
IOException- I/O exception
-
-
Method Details
-
execute
Parses and executes the input string.- Parameters:
command- base uri (name) and command string (value)- Returns:
falseif the exit command was sent- Throws:
IOException- database exception
-
execute
Execute the commands from the given command parser.- Parameters:
parser- command parser- Returns:
falseif the exit command was sent- Throws:
IOException- database exception
-
execute
Executes the specified command and optionally prints some information.- Parameters:
cmd- command to be runinfo- verbose flag- Throws:
IOException- I/O exception
-
session
Returns the session.- Returns:
- session
- Throws:
IOException- I/O exception
-
input
Returns the base URI and the query string for the specified input.- Parameters:
input- input- Returns:
- return base URI and query string
- Throws:
IOException- I/O exception
-
local
protected boolean local()Indicates if this is a local client.- Returns:
- local mode
-