|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exist.xquery.XQueryContext
The current XQuery execution context. Contains the static as well as the dynamic XQuery context components.
Field Summary | |
static java.lang.String |
HTTP_SESSIONVAR_XMLDB_USER
|
static java.lang.String |
XQUERY_CONTEXTVAR_XQUERY_UPDATE_ERROR
|
static java.lang.String |
XQUERY_LOCAL_NS
|
Constructor Summary | |
XQueryContext(DBBroker broker,
AccessContext accessCtx)
|
|
XQueryContext(XQueryContext copyFrom)
|
Method Summary | |
void |
addForwardReference(FunctionCall call)
Add a forward reference to an undeclared function. |
void |
addOption(java.lang.String qnameString,
java.lang.String contents)
|
boolean |
checkModulesValid()
For compiled expressions: check if the source of any module imported by the current query has changed since compilation. |
void |
clearNamespaces()
Clear all user-defined prefix/namespace mappings. |
void |
declareFunction(UserDefinedFunction function)
Declare a user-defined function. |
Variable |
declareGlobalVariable(Variable var)
Declare a global variable as by "declare variable". |
void |
declareInScopeNamespace(java.lang.String prefix,
java.lang.String uri)
Declare an in-scope namespace. |
void |
declareNamespace(java.lang.String prefix,
java.lang.String uri)
Declare a user-defined prefix/namespace mapping. |
void |
declareNamespaces(java.util.Map namespaceMap)
|
Variable |
declareVariable(java.lang.String qname,
java.lang.Object value)
Declare a user-defined variable. |
LocalVariable |
declareVariableBinding(LocalVariable var)
Declare a local variable. |
void |
finishBatchTransaction()
Completes a batch transaction, by committing the transaction and calling finish on any triggers set by setBatchTransactionTrigger() |
void |
functionEnd()
Report the end of the currently executed function. |
void |
functionStart(FunctionSignature signature)
Report the start of a function execution. |
AccessContext |
getAccessContext()
|
AnyURIValue |
getBaseURI()
Get the base URI of the evaluation context. |
Txn |
getBatchTransaction()
Get the Transaction for the batch |
DBBroker |
getBroker()
Get the DBBroker instance used for the current query. |
java.text.Collator |
getCollator(java.lang.String uri)
|
int |
getContextPosition()
Get the current context position, i.e. |
int |
getCurrentStackSize()
Returns the current size of the stack. |
java.lang.String |
getDefaultCollation()
|
java.text.Collator |
getDefaultCollator()
|
java.lang.String |
getDefaultFunctionNamespace()
Returns the current default function namespace. |
MemTreeBuilder |
getDocumentBuilder()
Get the document builder currently used for creating temporary document fragments. |
int |
getExpressionCount()
Returns the number of expression objects in the internal representation of the query. |
DocumentSet |
getLockedDocuments()
Returns the set of documents that have been loaded and locked during query execution. |
Module |
getModule(java.lang.String namespaceURI)
Get the built-in module registered for the given namespace URI. |
java.lang.String |
getModuleLoadPath()
|
java.util.Iterator |
getModules()
|
Option |
getOption(QName qname)
|
ExistPDP |
getPDP()
Convenience method that returns the XACML Policy Decision Point for this database instance. |
Pragma |
getPragma(java.lang.String name,
java.lang.String contents)
|
java.lang.String |
getPrefixForURI(java.lang.String uri)
|
Profiler |
getProfiler()
Returns the Profiler instance of this context
if profiling is enabled. |
Expression |
getRootExpression()
Returns the root expression of the XQuery associated with this context. |
java.util.Iterator |
getSignaturesForFunction(QName name)
|
DocumentSet |
getStaticallyKnownDocuments()
|
java.lang.String |
getURIForPrefix(java.lang.String prefix)
Return the namespace URI mapped to the registered prefix or null if the prefix is not registered. |
User |
getUser()
Get the user which executes the current query. |
XQueryWatchDog |
getWatchDog()
|
java.lang.Object |
getXQueryContextVar(java.lang.String name)
Get an XQuery Context variable. |
boolean |
hasBatchTransaction()
Determines if a batch transaction should be performed |
void |
importModule(java.lang.String namespaceURI,
java.lang.String prefix,
java.lang.String location)
Import a module and make it available in this context. |
boolean |
isBackwardsCompatible()
XPath 1.0 backwards compatibility turned on? In XPath 1.0 compatible mode, additional conversions will be applied to values if a numeric value is expected. |
boolean |
isProfilingEnabled()
|
boolean |
isProfilingEnabled(int verbosity)
|
boolean |
isVarDeclared(QName qname)
|
Module |
loadBuiltInModule(java.lang.String namespaceURI,
java.lang.String moduleClass)
Load a built-in module from the given class name and assign it to the namespace URI. |
java.util.Iterator |
localFunctions()
|
boolean |
lockDocumentsOnLoad()
Should loaded documents be locked? |
LocalVariable |
markLocalVariables(boolean newContext)
Returns the last variable on the local variable stack. |
void |
popDocumentContext()
|
void |
popInScopeNamespaces()
|
void |
popLocalVariables(LocalVariable var)
Restore the local variable stack to the position marked by variable var. |
void |
popNamespaceContext()
|
void |
prepare()
Prepares the current context before xquery execution |
void |
proceed()
|
void |
proceed(Expression expr)
|
void |
proceed(Expression expr,
MemTreeBuilder builder)
|
void |
pushDocumentContext()
Push any document fragment created within the current execution context on the stack. |
void |
pushInScopeNamespaces()
Push all in-scope namespace declarations onto the stack. |
void |
pushNamespaceContext()
|
void |
recover()
|
void |
registerUpdateListener(UpdateListener listener)
|
void |
releaseLockedDocuments()
Release all locks on documents that have been locked during query execution. |
DocumentSet |
releaseUnusedDocuments(Sequence seq)
Release all locks on documents not being referenced by the sequence. |
void |
removeNamespace(java.lang.String uri)
Removes the namespace URI from the prefix/namespace mappings table. |
void |
reset()
Prepare this XQueryContext to be reused. |
void |
resolveForwardReferences()
Resolve all forward references to previously undeclared functions. |
UserDefinedFunction |
resolveFunction(QName name,
int argCount)
Resolve a user-defined function. |
Variable |
resolveVariable(QName qname)
Try to resolve a variable. |
Variable |
resolveVariable(java.lang.String name)
Try to resolve a variable. |
void |
setBackwardsCompatibility(boolean backwardsCompatible)
Turn on/off XPath 1.0 backwards compatibility. |
void |
setBaseURI(AnyURIValue uri)
Set the base URI for the evaluation context. |
void |
setBaseURI(AnyURIValue uri,
boolean setInProlog)
Set the base URI for the evaluation context. |
void |
setBatchTransactionTrigger(DocumentImpl doc)
Set's that a trigger should be executed for the provided document as part of the batch transaction |
void |
setBroker(DBBroker broker)
|
void |
setContextPosition(int pos)
Set the current context position, i.e. |
void |
setDefaultCollation(java.lang.String uri)
Set the default collation to be used by all operators and functions on strings. |
void |
setDefaultFunctionNamespace(java.lang.String uri)
Set the default function namespace. |
void |
setLockDocumentsOnLoad(boolean lock)
If lock is true, all documents loaded during query execution will be locked. |
void |
setModuleLoadPath(java.lang.String path)
Set the path to a base directory where modules should be loaded from. |
void |
setRootExpression(Expression expr)
Called from the XQuery compiler to set the root expression for this context. |
void |
setStaticallyKnownDocuments(DocumentSet set)
|
void |
setStaticallyKnownDocuments(XmldbURI[] docs)
Set the set of statically known documents for the current execution context. |
void |
setStripWhitespace(boolean strip)
|
void |
setXQueryContextVar(java.lang.String name,
java.lang.Object XQvar)
Set an XQuery Context variable. |
void |
setXQuerySerializer(java.lang.String name,
boolean indent,
boolean omitxmldeclaration)
Set the serializer to use for output Used by the context extension module; called by context:set-serializer(). |
void |
startBatchTransaction()
Starts a batch Transaction |
DocumentImpl |
storeTemporaryDoc(DocumentImpl doc)
Store the supplied data to a temporary document fragment. |
boolean |
stripWhitespace()
Returns true if whitespace between constructed element nodes should be stripped by default. |
boolean |
tailRecursiveCall(FunctionSignature signature)
Check if the specified function signature is found in the current function called stack. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String XQUERY_LOCAL_NS
public static final java.lang.String XQUERY_CONTEXTVAR_XQUERY_UPDATE_ERROR
public static final java.lang.String HTTP_SESSIONVAR_XMLDB_USER
Constructor Detail |
public XQueryContext(DBBroker broker, AccessContext accessCtx)
public XQueryContext(XQueryContext copyFrom)
Method Detail |
public void prepare()
public AccessContext getAccessContext()
public boolean isProfilingEnabled()
public boolean isProfilingEnabled(int verbosity)
public Profiler getProfiler()
Profiler
instance of this context
if profiling is enabled.
public void setRootExpression(Expression expr)
expr
- public Expression getRootExpression()
public int getExpressionCount()
public void declareNamespace(java.lang.String prefix, java.lang.String uri) throws XPathException
prefix
- uri
-
XPathException
public void declareNamespaces(java.util.Map namespaceMap)
public void declareInScopeNamespace(java.lang.String prefix, java.lang.String uri)
prefix
- uri
- public java.lang.String getDefaultFunctionNamespace()
public void setDefaultFunctionNamespace(java.lang.String uri) throws XPathException
uri
-
XPathException
public void setDefaultCollation(java.lang.String uri) throws XPathException
uri
-
XPathException
public java.lang.String getDefaultCollation()
public java.text.Collator getCollator(java.lang.String uri) throws XPathException
XPathException
public java.text.Collator getDefaultCollator()
public java.lang.String getURIForPrefix(java.lang.String prefix)
prefix
-
public java.lang.String getPrefixForURI(java.lang.String uri)
uri
-
public void removeNamespace(java.lang.String uri)
uri
- public void clearNamespaces()
public void setStaticallyKnownDocuments(XmldbURI[] docs)
docs
- public void setStaticallyKnownDocuments(DocumentSet set)
public DocumentSet getStaticallyKnownDocuments() throws XPathException
XPathException
public boolean lockDocumentsOnLoad()
setLockDocumentsOnLoad(boolean)
public void setLockDocumentsOnLoad(boolean lock)
lock
- public DocumentSet getLockedDocuments()
setLockDocumentsOnLoad(boolean)
public void releaseLockedDocuments()
setLockDocumentsOnLoad(boolean)
public DocumentSet releaseUnusedDocuments(Sequence seq) throws XPathException
seq
-
XPathException
public void reset()
public boolean stripWhitespace()
public void setStripWhitespace(boolean strip)
public java.util.Iterator getModules()
public Module getModule(java.lang.String namespaceURI)
namespaceURI
-
public boolean checkModulesValid()
public Module loadBuiltInModule(java.lang.String namespaceURI, java.lang.String moduleClass)
Module
. The method will try to instantiate the class. If the
class is not found or an exception is thrown, the method will silently
fail. The namespace URI has to be equal to the namespace URI declared
by the module class. Otherwise, the module is not loaded.
namespaceURI
- moduleClass
- public ExistPDP getPDP()
public void declareFunction(UserDefinedFunction function) throws XPathException
function
-
XPathException
public UserDefinedFunction resolveFunction(QName name, int argCount) throws XPathException
name
-
XPathException
public java.util.Iterator getSignaturesForFunction(QName name)
public java.util.Iterator localFunctions()
public LocalVariable declareVariableBinding(LocalVariable var) throws XPathException
var
-
XPathException
public Variable declareGlobalVariable(Variable var) throws XPathException
var
-
XPathException
public Variable declareVariable(java.lang.String qname, java.lang.Object value) throws XPathException
qname
- the qualified name of the new variable. Any namespaces should
have been declared before.value
- a Java object, representing the fixed value of the variable
XPathException
- if the value cannot be converted into a known XPath value
or the variable QName references an unknown namespace-prefix.public Variable resolveVariable(java.lang.String name) throws XPathException
name
- the qualified name of the variable as string
XPathException
- if the variable is unknownpublic Variable resolveVariable(QName qname) throws XPathException
qname
- the qualified name of the variable
XPathException
- if the variable is unknownpublic boolean isVarDeclared(QName qname)
public void setBackwardsCompatibility(boolean backwardsCompatible)
backwardsCompatible
- public boolean isBackwardsCompatible()
public DBBroker getBroker()
public void setBroker(DBBroker broker)
public User getUser()
public MemTreeBuilder getDocumentBuilder()
public void proceed() throws TerminatedException
TerminatedException
public void proceed(Expression expr) throws TerminatedException
TerminatedException
public void proceed(Expression expr, MemTreeBuilder builder) throws TerminatedException
TerminatedException
public void recover()
public XQueryWatchDog getWatchDog()
public void pushDocumentContext()
public void popDocumentContext()
public void setBaseURI(AnyURIValue uri)
uri
- public void setBaseURI(AnyURIValue uri, boolean setInProlog)
uri
- setInProlog
- public void setModuleLoadPath(java.lang.String path)
path
- public java.lang.String getModuleLoadPath()
public AnyURIValue getBaseURI()
public void setContextPosition(int pos)
pos
- public int getContextPosition()
public void pushInScopeNamespaces()
public void popInScopeNamespaces()
public void pushNamespaceContext()
public void popNamespaceContext()
public LocalVariable markLocalVariables(boolean newContext)
popLocalVariables(LocalVariable)
.
public void popLocalVariables(LocalVariable var)
var
- public int getCurrentStackSize()
public void functionStart(FunctionSignature signature)
public void functionEnd()
public boolean tailRecursiveCall(FunctionSignature signature)
signature
- public void importModule(java.lang.String namespaceURI, java.lang.String prefix, java.lang.String location) throws XPathException
namespaceURI
- prefix
- location
-
XPathException
public void addForwardReference(FunctionCall call)
call
- public void resolveForwardReferences() throws XPathException
XPathException
public void addOption(java.lang.String qnameString, java.lang.String contents) throws XPathException
XPathException
public Option getOption(QName qname)
public Pragma getPragma(java.lang.String name, java.lang.String contents) throws XPathException
XPathException
public DocumentImpl storeTemporaryDoc(DocumentImpl doc) throws XPathException
doc
-
XPathException
public void setXQueryContextVar(java.lang.String name, java.lang.Object XQvar)
name
- The variable nameXQvar
- The variable value, may be of any xs: typepublic java.lang.Object getXQueryContextVar(java.lang.String name)
name
- The variable name
public void startBatchTransaction() throws TransactionException
TransactionException
public boolean hasBatchTransaction()
public Txn getBatchTransaction()
public void setBatchTransactionTrigger(DocumentImpl doc)
doc
- The document to trigger forpublic void finishBatchTransaction() throws TransactionException
TransactionException
public void setXQuerySerializer(java.lang.String name, boolean indent, boolean omitxmldeclaration) throws XPathException
name
- The name of the serializer to useindent
- Should the output be indented?omitxmldeclaration
- Should the output omit the xml declaration?
XPathException
public void registerUpdateListener(UpdateListener listener)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |