org.exist.xquery
Interface Module

All Known Subinterfaces:
ExternalModule, InternalModule
All Known Implementing Classes:
AbstractInternalModule, BackupModule, CacheModule, CompressionModule, ContextModule, CounterModule, DateTimeModule, ExampleModule, ExiftoolModule, ExiModule, ExpathPackageModule, ExternalModuleImpl, FileModule, FnModule, FTPClientModule, HttpClientModule, HTTPClientModule, ImageModule, JNDIModule, LDAPModule, LuceneModule, MailModule, MathModule, Module, NGramModule, RequestModule, ResponseModule, SchedulerModule, SecurityManagerModule, SessionModule, SimpleQLModule, SortModule, SQLModule, SystemModule, TextModule, TransformModule, UtilModule, ValidationModule, VersioningModule, XcryptModule, XMLDBModule, XmlDiffModule, XQDocModule, XSLModule, ZipModule

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.


Method Summary
 Variable declareVariable(QName qname, java.lang.Object value)
           
 Variable declareVariable(Variable var)
           
 java.lang.String getDefaultPrefix()
          Returns an optional default prefix (used if no prefix is supplied with the "import module" directive).
 java.lang.String getDescription()
          Return a short description of this module to be displayed to a user.
 java.util.Iterator<QName> getGlobalVariables()
          Returns an iterator over all global variables in this modules, which were either declared with "declare variable" (for external modules) or set in the module implementation (internal modules).
 java.lang.String getNamespaceURI()
          Returns the namespace URI that uniquely identifies this module.
 java.lang.String getReleaseVersion()
          Returns the release version in which the module was firstly available.
 java.util.Iterator<FunctionSignature> 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

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

Returns:
namespace URI

getDefaultPrefix

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

Returns:
optional default prefix

getDescription

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

Returns:
short description of this module

getReleaseVersion

java.lang.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

java.util.Iterator<FunctionSignature> 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,
                         java.lang.Object value)
                         throws XPathException
Throws:
XPathException

declareVariable

Variable declareVariable(Variable var)

isVarDeclared

boolean isVarDeclared(QName qname)

getGlobalVariables

java.util.Iterator<QName> getGlobalVariables()
Returns an iterator over all global variables in this modules, which were either declared with "declare variable" (for external modules) or set in the module implementation (internal modules).

Returns:

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.