|
||||||||||
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.QueryProcessor
public final class QueryProcessor
This class is an entry point for evaluating XQuery implementations.
Field Summary | |
---|---|
QueryContext |
ctx
Expression context. |
Fields inherited from class org.basex.core.Proc |
---|
listen, updating |
Constructor Summary | |
---|---|
QueryProcessor(java.lang.String qu,
Context cx)
Default constructor. |
Method Summary | |
---|---|
QueryProcessor |
bind(java.lang.String name,
java.lang.Object value)
Binds a value to a global variable. |
QueryProcessor |
bind(java.lang.String name,
java.lang.Object value,
java.lang.String type)
Binds a value with the specified data type to a global variable. |
void |
close()
Closes the processor. |
void |
compile()
Compiles the query. |
QueryProcessor |
context(Nodes nodes)
Binds an initial nodeset to the context item. |
QueryProcessor |
context(java.lang.Object value)
Binds a value to the context item. |
QueryProcessor |
context(java.lang.Object value,
java.lang.String type)
Binds a value with the specified data type to the context item, using the same rules as for binding variables . |
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. |
Result |
execute()
Evaluates the specified query and returns the result. |
Serializer |
getSerializer(java.io.OutputStream os)
Returns a serializer for the given output stream. |
java.lang.String |
info()
Returns query background information. |
static boolean |
isLibrary(java.lang.String qu)
Checks if the specified XQuery string is a library module. |
Iter |
iter()
Returns a result iterator. |
void |
module(java.lang.String uri,
java.lang.String file)
Adds a module reference. |
QueryProcessor |
namespace(java.lang.String prefix,
java.lang.String uri)
Declares a namespace. |
void |
parse()
Parses the query. |
FDoc |
plan()
Returns a tree representation of the query plan. |
java.lang.String |
query()
Returns the query string. |
Nodes |
queryNodes()
Evaluates the specified query and returns the result nodes. |
static java.lang.String |
removeComments(java.lang.String qu,
int max)
Removes comments from the specified string and returns the first characters of a query. |
java.lang.String |
tit()
Returns short information on this process. |
java.lang.String |
toString()
|
int |
updates()
Returns the number of performed updates after query execution, or 0 . |
Value |
value()
Returns a result value. |
Methods inherited from class org.basex.core.Proc |
---|
abort, checkStop, detail, listen, proc, prog, progress, registered, registered, startTimeout, stop, stopTimeout, title |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final QueryContext ctx
Constructor Detail |
---|
public QueryProcessor(java.lang.String qu, Context cx)
qu
- query to processcx
- database contextMethod Detail |
---|
public void parse() throws QueryException
QueryException
- query exceptionpublic void compile() throws QueryException
QueryException
- query exceptionpublic Iter iter() throws QueryException
QueryException
- query exceptionpublic Value value() throws QueryException
QueryException
- query exceptionpublic Result execute() throws QueryException
QueryException
- query exceptionpublic QueryProcessor bind(java.lang.String name, java.lang.Object value, java.lang.String type) throws QueryException
Expr
instance, it is directly assigned.
Otherwise, it is first cast to the appropriate XQuery type. If "json"
is specified as data type, the value is interpreted according to the rules
specified in JsonMapConverter
.
name
- name of variablevalue
- value to be boundtype
- data type (may be null
)
QueryException
- query exceptionpublic QueryProcessor bind(java.lang.String name, java.lang.Object value) throws QueryException
name
- name of variablevalue
- value to be bound
QueryException
- query exceptionpublic QueryProcessor context(java.lang.Object value) throws QueryException
value
- value to be bound
QueryException
- query exceptionpublic QueryProcessor context(java.lang.Object value, java.lang.String type) throws QueryException
binding variables
.
value
- value to be boundtype
- data type (may be null
)
QueryException
- query exceptionpublic QueryProcessor context(Nodes nodes)
nodes
- node set
public QueryProcessor namespace(java.lang.String prefix, java.lang.String uri) throws QueryException
uri
is an empty string.
The default element namespaces is set if the prefix
is empty.
prefix
- namespace prefixuri
- namespace uri
QueryException
- query exceptionpublic Serializer getSerializer(java.io.OutputStream os) throws java.io.IOException, QueryException
os
- output stream
java.io.IOException
- query exception
QueryException
- query exceptionpublic Nodes queryNodes() throws QueryException
QueryException
- query exceptionpublic void module(java.lang.String uri, java.lang.String file)
uri
- module urifile
- file namepublic java.lang.String query()
public void close()
public void databases(LockResult lr)
Proc
databases
in class Proc
lr
- Container for lock result to pass aroundpublic int updates()
0
.
public java.lang.String info()
public static boolean isLibrary(java.lang.String qu)
qu
- query string
public static java.lang.String removeComments(java.lang.String qu, int max)
qu
- query stringmax
- maximum length of string to return
public FDoc plan()
public java.lang.String tit()
Proc
tit
in class Proc
public java.lang.String det()
Proc
det
in class Proc
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |