org.exist.xquery
Interface Module

All Known Subinterfaces:
ExternalModule, InternalModule
All Known Implementing Classes:
AbstractInternalModule, BackupModule, ExternalModuleImpl, ModuleImpl, RequestModule, ResponseModule, SessionModule, SystemModule, TextModule, TransformModule, UtilModule, ValidationModule, XMLDBModule

public interface Module

Defines an XQuery library module. A module consists of function definitions and global variables. It is uniquely identified by a namespace URI and an optional default namespace prefix. All functions provided by the module have to be defined in the module's namespace. Modules can be either internal or external: internal modules are collections of Java classes, each being a subclass of Function. External modules are defined by the XQuery "module" directive and can be loaded with "import module". Modules are dynamically loaded by class XQueryContext, either during the initialization phase of the query engine (for the standard library modules) or upon an "import module" directive.

Author:
Wolfgang Meier (wolfgang@exist-db.org)

Method Summary
 Variable declareVariable(QName qname, Object value)
           
 Variable declareVariable(Variable var)
           
 String getDefaultPrefix()
          Returns an optional default prefix (used if no prefix is supplied with the "import module" directive).
 String getDescription()
          Return a short description of this module to be displayed to a user.
 String getNamespaceURI()
          Returns the namespace URI that uniquely identifies this module.
 String getReleaseVersion()
          Returns the release version in which the module was firstly available.
 Iterator getSignaturesForFunction(QName qname)
          Try to find the signature of the function identified by its QName.
 boolean isInternalModule()
          Is this an internal module?
 boolean isReady()
          Check if this module has been fully loaded and is ready for use.
 boolean isVarDeclared(QName qname)
           
 FunctionSignature[] listFunctions()
          Returns the signatures of all functions defined within this module.
 void reset(XQueryContext xqueryContext)
          Reset the module's internal state for being reused.
 Variable resolveVariable(QName qname)
           
 

Method Detail

getNamespaceURI

String getNamespaceURI()
Returns the namespace URI that uniquely identifies this module.

Returns:
namespace URI

getDefaultPrefix

String getDefaultPrefix()
Returns an optional default prefix (used if no prefix is supplied with the "import module" directive).

Returns:
optional default prefix

getDescription

String getDescription()
Return a short description of this module to be displayed to a user.

Returns:
short description of this module

getReleaseVersion

String getReleaseVersion()
Returns the release version in which the module was firstly available.

Returns:
available from which release version

isInternalModule

boolean isInternalModule()
Is this an internal module?

Returns:
True if is internal module.

listFunctions

FunctionSignature[] listFunctions()
Returns the signatures of all functions defined within this module.

Returns:
signatures of all functions

getSignaturesForFunction

Iterator getSignaturesForFunction(QName qname)
Try to find the signature of the function identified by its QName.

Parameters:
qname -
Returns:
the function signature or null if the function is not defined.

resolveVariable

Variable resolveVariable(QName qname)
                         throws XPathException
Throws:
XPathException

declareVariable

Variable declareVariable(QName qname,
                         Object value)
                         throws XPathException
Throws:
XPathException

declareVariable

Variable declareVariable(Variable var)

isVarDeclared

boolean isVarDeclared(QName qname)

reset

void reset(XQueryContext xqueryContext)
Reset the module's internal state for being reused.


isReady

boolean isReady()
Check if this module has been fully loaded and is ready for use.

Returns:
false while the module is being compiled.


Copyright (C) Wolfgang Meier. All rights reserved.