public class QueryPlus extends Object
Modifier and Type | Class and Description |
---|---|
static class |
QueryPlus.DefaultDependencies
A default implementation of
QueryPlus.Dependencies . |
static interface |
QueryPlus.Dependencies
The Dependencies for QueryPlus.
|
static class |
QueryPlus.DependenciesHelper
The DependenciesHelper provides helper method for constructing
QueryPlus.Dependencies implementations for QueryPlus . |
Modifier and Type | Field and Description |
---|---|
protected ExecutionContext |
f_context
The
ExecutionContext that will be passed to Statement s. |
protected QueryPlus.Dependencies |
f_dependencies
The
QueryPlus.Dependencies configuring this query session. |
protected StatementExecutor |
f_executor
The
StatementExecutor to use to execute statements. |
Constructor and Description |
---|
QueryPlus(QueryPlus.Dependencies dependencies)
Create a QueryPlus instance that uses the specified
QueryPlus.Dependencies . |
Modifier and Type | Method and Description |
---|---|
protected void |
addAlterSessionStatement()
Add the QueryPlus ALTER SESSION statements
|
protected void |
addStatement(AbstractQueryPlusStatementBuilder builder)
Add a new QueryPlus statement.
|
protected boolean |
evalLine(String sLine)
Evaluate the given CohQL statement.
|
ExecutionContext |
getExecutionContext()
Return the current
ExecutionContext passed to Statement s. |
static BufferedReader |
getJlineReader(OutputStream output,
InputStream input,
boolean fSilent)
Return an instance of BufferedReader if JLine is present.
|
protected void |
initializeLanguage()
Initialize the
CoherenceQueryLanguage with any QueryPlus
Statement extensions. |
static void |
main(String[] asArgs)
The main application for CohQL statement processing.
|
protected boolean |
processFile(String sFileName)
Process the given file of CohQL statements.
|
protected Object |
query(String sQuery)
Process the specified query.
|
void |
repl()
Start a statement processing loop.
|
void |
run()
Run this instance of QueryPlus.
|
protected final QueryPlus.Dependencies f_dependencies
QueryPlus.Dependencies
configuring this query session.protected final ExecutionContext f_context
ExecutionContext
that will be passed to Statement
s.protected final StatementExecutor f_executor
StatementExecutor
to use to execute statements.public QueryPlus(QueryPlus.Dependencies dependencies)
QueryPlus.Dependencies
.dependencies
- the Dependencies that will control the QueryPlus sessionpublic void run()
public void repl()
public ExecutionContext getExecutionContext()
ExecutionContext
passed to Statement
s.protected void initializeLanguage()
CoherenceQueryLanguage
with any QueryPlus
Statement
extensions.protected void addStatement(AbstractQueryPlusStatementBuilder builder)
builder
- the statement builder to addprotected void addAlterSessionStatement()
protected Object query(String sQuery)
sQuery
- a String that represents the queryprotected boolean processFile(String sFileName)
sFileName
- the name of the file CohQL containing the
statements to executeprotected boolean evalLine(String sLine)
sLine
- the CohQL statement String to be evaluatedpublic static BufferedReader getJlineReader(OutputStream output, InputStream input, boolean fSilent)
output
- the OutputStream
that will provide outputinput
- the InputStream
that will provide inputfSilent
- if true no message will be displayed if JLine is unavailable.public static void main(String[] asArgs)
asArgs
- an array of Strings that represents arguments