|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.core.Proc
org.basex.query.QueryContext
public final class QueryContext
This class organizes both static and dynamic properties that are specific to a single query.
Field Summary | |
---|---|
java.util.HashMap<QNm,Expr> |
bindings
Externally bound variables. |
TokenObjMap<Collation> |
collations
Available collations. |
Context |
context
Database context. |
MainModule |
ctxItem
Initial context value. |
Item |
date
Current Date. |
StringList |
dbOptions
Local options (key/value pairs), set by option declarations. |
Item |
dtm
Current DateTime. |
byte |
ftoknum
Full-text token counter (needed for highlighting of full-text results). |
FTPosData |
ftpos
Full-text position data (needed for highlighting of full-text results). |
FTLexer |
fttoken
Current full-text token. |
StaticFuncs |
funcs
Functions. |
java.util.HashMap<java.lang.String,java.lang.Object> |
globalOpt
Global options (will be set after query execution). |
java.lang.Object |
http
HTTP context. |
boolean |
leaf
Compilation flag: current node has leaves. |
int |
maxCalls
Maximum number of successive tail calls. |
ModuleLoader |
modules
Module loader. |
ValueBuilder |
output
Pending output. |
long |
pos
Current context position. |
StringList |
readLocks
Strings to lock defined by lock:read option. |
QueryResources |
resource
Query resources. |
StaticContext |
sc
Static context of an expression. |
long |
size
Current context size. |
QueryStack |
stack
The evaluation stack. |
java.util.HashMap<java.lang.String,IO> |
stop
Cached stop word files. |
int |
tailCalls
Number of successive tail calls. |
java.util.HashMap<java.lang.String,IO> |
thes
Cached thesaurus files. |
Item |
time
Current Time. |
Updates |
updates
Pending updates. |
Value |
value
Current context value. |
int |
varIDs
Counter for variable IDs. |
Variables |
vars
Static variables. |
StringList |
writeLocks
Strings to lock defined by lock:write option. |
Item |
zone
Current timezone. |
Fields inherited from class org.basex.core.Proc |
---|
listen, updating |
Constructor Summary | |
---|---|
QueryContext(Context ctx)
Constructor. |
Method Summary | |
---|---|
void |
analyze()
Compiles all used functions and the root expression. |
void |
bind(java.lang.String name,
java.lang.Object val,
java.lang.String type)
Binds a value to a global variable. |
void |
close()
Closes the query context. |
void |
compile()
Compiles and optimizes the expression. |
void |
compInfo(java.lang.String string,
java.lang.Object... ext)
Adds some compilation info. |
void |
context(java.lang.Object val,
java.lang.String type)
Binds a value to the context item, using the same rules as for binding variables . |
Data |
data()
Returns the current data reference of the context value, or null . |
void |
databases(LockResult lr)
Adds the names of the databases that may be touched by the process. |
java.lang.String |
det()
Returns short information on this process. |
void |
evalInfo(java.lang.String string)
Adds some evaluation info. |
FTOpt |
ftOpt()
Returns the current full-text options. |
void |
ftOpt(FTOpt opt)
Sets full-text options. |
Value |
get(Var var)
Gets the value currently bound to the given variable. |
java.lang.String |
info()
Returns info on query compilation and evaluation. |
QueryContext |
initDateTime()
Initializes the static date and time context of a query if not done yet. |
Iter |
iter()
Returns a result iterator. |
Iter |
iter(Expr e)
Evaluates the specified expression and returns an iterator. |
JDBCConnections |
jdbc()
Returns JDBC connections. |
void |
mainModule(MainModule rt)
Sets the main module (root expression). |
LibraryModule |
parseLibrary(java.lang.String qu,
java.lang.String path)
Parses the specified module. |
MainModule |
parseMain(java.lang.String qu,
java.lang.String path)
Parses the specified query. |
double |
prog()
Returns a progress value (0 - 1). |
SerializerProp |
serParams(boolean optional)
Returns the serialization parameters used for and specified by this query. |
ClientSessions |
sessions()
Returns client sessions. |
void |
set(Var vr,
Value vl,
InputInfo ii)
Binds an expression to a local variable. |
java.lang.String |
tit()
Returns short information on this process. |
Value |
update()
Performs updates. |
void |
updating(boolean up)
Sets the updating flag. |
Value |
value()
Returns the result value. |
Value |
value(Expr expr)
Evaluates the specified expression and returns an iterator. |
Methods inherited from class org.basex.core.Proc |
---|
abort, checkStop, detail, listen, proc, progress, registered, registered, startTimeout, stop, stopTimeout, title |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public StaticContext sc
public final Variables vars
public final StaticFuncs funcs
public final java.util.HashMap<QNm,Expr> bindings
public final QueryResources resource
public final Context context
public java.lang.Object http
public java.util.HashMap<java.lang.String,IO> stop
public java.util.HashMap<java.lang.String,IO> thes
public final StringList dbOptions
public final java.util.HashMap<java.lang.String,java.lang.Object> globalOpt
public Value value
public long pos
public long size
public TokenObjMap<Collation> collations
public FTLexer fttoken
public FTPosData ftpos
public byte ftoknum
public Item date
public Item dtm
public Item time
public Item zone
public StringList readLocks
public StringList writeLocks
public Updates updates
public final ValueBuilder output
public boolean leaf
public int tailCalls
public final int maxCalls
public int varIDs
public MainModule ctxItem
public final ModuleLoader modules
public final QueryStack stack
Constructor Detail |
---|
public QueryContext(Context ctx)
ctx
- database contextMethod Detail |
---|
public MainModule parseMain(java.lang.String qu, java.lang.String path) throws QueryException
qu
- input querypath
- file path (may be null
)
QueryException
- query exceptionpublic LibraryModule parseLibrary(java.lang.String qu, java.lang.String path) throws QueryException
qu
- input querypath
- file path (may be null
)
QueryException
- query exceptionpublic void mainModule(MainModule rt)
rt
- main modulepublic void compile() throws QueryException
QueryException
- query exceptionpublic void analyze() throws QueryException
QueryException
- query exceptionpublic Iter iter() throws QueryException
QueryException
- query exceptionpublic Value value() throws QueryException
QueryException
- query exceptionpublic Value update() throws QueryException
QueryException
- query exceptionpublic Iter iter(Expr e) throws QueryException
e
- expression to be evaluated
QueryException
- query exceptionpublic Value value(Expr expr) throws QueryException
expr
- expression to be evaluated
QueryException
- query exceptionpublic Data data()
null
.
public void databases(LockResult lr)
Proc
databases
in class Proc
lr
- Container for lock result to pass aroundpublic void context(java.lang.Object val, java.lang.String type) throws QueryException
binding variables
.
val
- value to be boundtype
- data type (may be null
)
QueryException
- query exceptionpublic void bind(java.lang.String name, java.lang.Object val, java.lang.String type) throws QueryException
"json"
is specified, the value is converted according to the rules
specified in JsonMapConverter
."xml"
is specified, the value is converted to a document node.Value
, it is directly assigned.
Otherwise, it is cast to the XQuery data model, using a Java/XQuery mapping.
name
- name of variableval
- value to be boundtype
- data type (may be null
)
QueryException
- query exceptionpublic void compInfo(java.lang.String string, java.lang.Object... ext)
string
- evaluation infoext
- text text extensionspublic void evalInfo(java.lang.String string)
string
- evaluation infopublic java.lang.String info()
public JDBCConnections jdbc()
public ClientSessions sessions()
public SerializerProp serParams(boolean optional)
optional
- if true
, a null
reference is returned if no
parameters have been specified
public FTOpt ftOpt()
public void ftOpt(FTOpt opt)
opt
- full-text optionspublic void updating(boolean up)
up
- updating flagpublic void close()
public java.lang.String tit()
Proc
tit
in class Proc
public java.lang.String det()
Proc
det
in class Proc
public double prog()
Proc
prog
in class Proc
public Value get(Var var)
var
- variable
public void set(Var vr, Value vl, InputInfo ii) throws QueryException
vr
- variablevl
- expression to be boundii
- input info
QueryException
- exceptionpublic QueryContext initDateTime() throws QueryException
QueryException
- query exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |