## org.exist.xquery
Class ModuleContext

    java.lang.Object
      org.exist.xquery.XQueryContext
          org.exist.xquery.ModuleContext

public class ModuleContext
extends XQueryContext

Subclass of `XQueryContext` for imported modules.

Author:
  wolf

Field Summary

Fields inherited from class org.exist.xquery.XQueryContext
`HTTP_SESSIONVAR_XMLDB_USER, XQUERY_CONTEXTVAR_XQUERY_UPDATE_ERROR, XQUERY_LOCAL_NS`

Constructor Summary
`ModuleContext(XQueryContext parentContext)`

Method Summary
`AnyURIValue` `getBaseURI()` Get the base URI of the evaluation context.
`DBBroker` `getBroker()` Get the DBBroker instance used for the current query.
`MemTreeBuilder` `getDocumentBuilder()` Get the document builder currently used for creating temporary document fragments.
`Module` `getModule(java.lang.String namespaceURI)` Get the built-in module registered for the given namespace URI.
`java.util.Iterator` `getModules()`
`DocumentSet` `getStaticallyKnownDocuments()`
`XQueryWatchDog` `getWatchDog()`
`java.lang.Object` `getXQueryContextVar(java.lang.String name)` Delegate to parent context
`void` `popDocumentContext()`
`void` `pushDocumentContext()` Push any document fragment created within the current execution context on the stack.
`void` `registerUpdateListener(UpdateListener listener)`
`void` `setBaseURI(AnyURIValue uri)` Set the base URI for the evaluation context.
`void` `setXQueryContextVar(java.lang.String name, java.lang.Object XQvar)` Delegate to parent context

Methods inherited from class org.exist.xquery.XQueryContext

`addForwardReference, addOption, checkModulesValid, clearNamespaces, declareFunction, declareGlobalVariable, declareInScopeNamespace, declareNamespace, declareNamespaces, declareVariable, declareVariableBinding, finishBatchTransaction, functionEnd, functionStart, getAccessContext, getBatchTransaction, getCollator, getContextPosition, getCurrentStackSize, getDefaultCollation, getDefaultCollator, getDefaultFunctionNamespace, getExpressionCount, getLockedDocuments, getModuleLoadPath, getOption, getPDP, getPragma, getPrefixForURI, getProfiler, getRootExpression, getSignaturesForFunction, getURIForPrefix, getUser, hasBatchTransaction, importModule, isBackwardsCompatible, isProfilingEnabled, isProfilingEnabled, isVarDeclared, loadBuiltInModule, localFunctions, lockDocumentsOnLoad, markLocalVariables, popInScopeNamespaces, popLocalVariables, popNamespaceContext, prepare, proceed, proceed, proceed, pushInScopeNamespaces, pushNamespaceContext, recover, releaseLockedDocuments, releaseUnusedDocuments, removeNamespace, reset, resolveForwardReferences, resolveFunction, resolveVariable, resolveVariable, setBackwardsCompatibility, setBaseURI, setBatchTransactionTrigger, setBroker, setContextPosition, setDefaultCollation, setDefaultFunctionNamespace, setLockDocumentsOnLoad, setModuleLoadPath, setRootExpression, setStaticallyKnownDocuments, setStaticallyKnownDocuments, setStripWhitespace, setXQuerySerializer, startBatchTransaction, storeTemporaryDoc, stripWhitespace, tailRecursiveCall`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ModuleContext

    public ModuleContext(XQueryContext parentContext)

Parameters:
  `parentContext` -

Method Detail

### getStaticallyKnownDocuments

    public DocumentSet getStaticallyKnownDocuments()
                                            throws XPathException

  Overrides:
    `getStaticallyKnownDocuments` in class `XQueryContext`
  Returns:
    set of statically known documents.
  Throws:
    `XPathException`

### getModule

    public Module getModule(java.lang.String namespaceURI)

  Description copied from class: `XQueryContext`
  Get the built-in module registered for the given namespace URI.

  Overrides:
    `getModule` in class `XQueryContext`
  Parameters:
    `namespaceURI` -
  Returns:
    built-in module

### getModules

    public java.util.Iterator getModules()

  Overrides:
    `getModules` in class `XQueryContext`
  Returns:
    iterator over all built-in modules currently registered.

### getWatchDog

    public XQueryWatchDog getWatchDog()

  Overrides:
    `getWatchDog` in class `XQueryContext`

### getBaseURI

    public AnyURIValue getBaseURI()

  Description copied from class: `XQueryContext`
  Get the base URI of the evaluation context. This is the URI returned by the fn:base-uri() function.

  Overrides:
    `getBaseURI` in class `XQueryContext`
  Returns:
    base URI of the evaluation context

### setBaseURI

    public void setBaseURI(AnyURIValue uri)

  Description copied from class: `XQueryContext`
  Set the base URI for the evaluation context. This is the URI returned by the fn:base-uri() function.

  Overrides:
    `setBaseURI` in class `XQueryContext`
  Parameters:
    `uri` -

### setXQueryContextVar

    public void setXQueryContextVar(java.lang.String name,
                                    java.lang.Object XQvar)

  Delegate to parent context

  Overrides:
    `setXQueryContextVar` in class `XQueryContext`
  Parameters:
    `name` - The variable name
    `XQvar` - The variable value, may be of any xs: type
  See Also:
    `XQueryContext.setXQueryContextVar(String, Object)`

### getXQueryContextVar

    public java.lang.Object getXQueryContextVar(java.lang.String name)

  Delegate to parent context

  Overrides:
    `getXQueryContextVar` in class `XQueryContext`
  Parameters:
    `name` - The variable name
  Returns:
    The variable value indicated by name.
  See Also:
    `XQueryContext.getXQueryContextVar(String)`

### getBroker

    public DBBroker getBroker()

  Description copied from class: `XQueryContext`
  Get the DBBroker instance used for the current query. The DBBroker is the main database access object, providing access to all internal database functions.

  Overrides:
    `getBroker` in class `XQueryContext`
  Returns:
    DBBroker instance

### getDocumentBuilder

    public MemTreeBuilder getDocumentBuilder()

  Description copied from class: `XQueryContext`
  Get the document builder currently used for creating temporary document fragments. A new document builder will be created on demand.

  Overrides:
    `getDocumentBuilder` in class `XQueryContext`
  Returns:
    document builder

### pushDocumentContext

    public void pushDocumentContext()

  Description copied from class: `XQueryContext`
  Push any document fragment created within the current execution context on the stack.

  Overrides:
    `pushDocumentContext` in class `XQueryContext`

### popDocumentContext

    public void popDocumentContext()

  Overrides:
    `popDocumentContext` in class `XQueryContext`

### registerUpdateListener

    public void registerUpdateListener(UpdateListener listener)

  Overrides:
    `registerUpdateListener` in class `XQueryContext`

Copyright (C) Wolfgang Meier. All rights reserved.