## org.exist.xquery
Interface Module

All Known Subinterfaces:
  ExternalModule, InternalModule

All Known Implementing Classes:
  AbstractInternalModule, ExternalModuleImpl

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)

Field Summary
`static java.lang.String` `REQUEST_FUNCTION_NS` Namespace for the built-in request module.
`static java.lang.String` `RESPONSE_FUNCTION_NS` Namespace for the built-in response module.
`static java.lang.String` `SESSION_FUNCTION_NS` Namespace for the built-in session module.
`static java.lang.String` `SYSTEM_FUNCTION_NS` Namespace for the built-in system module.
`static java.lang.String` `TEXT_FUNCTION_NS` Namespace for the built-in text module.
`static java.lang.String` `TRANSFORM_FUNCTION_NS` Namespace for the built-in transform module.
`static java.lang.String` `UTIL_FUNCTION_NS` Namespace for the built-in utility module.
`static java.lang.String` `XMLDB_FUNCTION_NS` Namespace for the built-in xmldb module.

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.lang.String` `getNamespaceURI()` Returns the namespace URI that uniquely identifies this module.
`java.util.Iterator` `getSignaturesForFunction(QName qname)` Try to find the signature of the function identified by its QName.
`boolean` `isInternalModule()` Is this an internal module?
`boolean` `isVarDeclared(QName qname)`
`FunctionSignature[]` `listFunctions()` Returns the signatures of all functions defined within this module.
`void` `reset()` Reset the module's internal state for being reused.
`Variable` `resolveVariable(QName qname)`

Field Detail

### XMLDB_FUNCTION_NS

    public static final java.lang.String XMLDB_FUNCTION_NS

  Namespace for the built-in xmldb module.

  See Also:
    Constant Field Values

### UTIL_FUNCTION_NS

    public static final java.lang.String UTIL_FUNCTION_NS

  Namespace for the built-in utility module.

  See Also:
    Constant Field Values

### REQUEST_FUNCTION_NS

    public static final java.lang.String REQUEST_FUNCTION_NS

  Namespace for the built-in request module.

  See Also:
    Constant Field Values

### RESPONSE_FUNCTION_NS

    public static final java.lang.String RESPONSE_FUNCTION_NS

  Namespace for the built-in response module.

  See Also:
    Constant Field Values

### SESSION_FUNCTION_NS

    public static final java.lang.String SESSION_FUNCTION_NS

  Namespace for the built-in session module.

  See Also:
    Constant Field Values

### SYSTEM_FUNCTION_NS

    public static final java.lang.String SYSTEM_FUNCTION_NS

  Namespace for the built-in system module.

  See Also:
    Constant Field Values

### TRANSFORM_FUNCTION_NS

    public static final java.lang.String TRANSFORM_FUNCTION_NS

  Namespace for the built-in transform module.

  See Also:
    Constant Field Values

### TEXT_FUNCTION_NS

    public static final java.lang.String TEXT_FUNCTION_NS

  Namespace for the built-in text module.

  See Also:
    Constant Field Values

Method Detail

### getNamespaceURI

    public java.lang.String getNamespaceURI()

  Returns the namespace URI that uniquely identifies this module.

  Returns:
    namespace URI

### getDefaultPrefix

    public 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

    public java.lang.String getDescription()

  Return a short description of this module to be displayed to a user.

  Returns:
    short description of this module

### isInternalModule

    public boolean isInternalModule()

  Is this an internal module?

  Returns:
    True if is internal module.

### listFunctions

    public FunctionSignature[] listFunctions()

  Returns the signatures of all functions defined within this module.

  Returns:
    signatures of all functions

### getSignaturesForFunction

    public java.util.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

    public Variable resolveVariable(QName qname)
                             throws XPathException

  Throws:
    `XPathException`

### declareVariable

    public Variable declareVariable(QName qname,
                                    java.lang.Object value)
                             throws XPathException

  Throws:
    `XPathException`

### declareVariable

    public Variable declareVariable(Variable var)

### isVarDeclared

    public boolean isVarDeclared(QName qname)

### reset

    public void reset()

  Reset the module's internal state for being reused.

Copyright (C) Wolfgang Meier. All rights reserved.