## org.exist.xquery
Interface ExternalModule

All Superinterfaces:
  Module

All Known Implementing Classes:
  ExternalModuleImpl

public interface ExternalModule
extends Module

An external library module implemented in XQuery and loaded through the "import module" directive.

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

Field Summary

Fields inherited from interface org.exist.xquery.Module
`REQUEST_FUNCTION_NS, RESPONSE_FUNCTION_NS, SESSION_FUNCTION_NS, SYSTEM_FUNCTION_NS, TEXT_FUNCTION_NS, TRANSFORM_FUNCTION_NS, UTIL_FUNCTION_NS, XMLDB_FUNCTION_NS`

Method Summary
`void` `declareFunction(UserDefinedFunction func)` Declare a new function.
`void` `declareVariable(QName qname, VariableDeclaration decl)`
`UserDefinedFunction` `getFunction(QName qname, int arity)` Try to find the function identified by qname.
`Source` `getSource()` Get the source object this module has been read from.
`boolean` `moduleIsValid()` Is this module still valid or should it be reloaded from its source?
`void` `setContext(XQueryContext context)` Set the XQueryContext of this module.
`void` `setSource(Source source)` Set the source object this module has been read from.

Methods inherited from interface org.exist.xquery.Module
`declareVariable, declareVariable, getDefaultPrefix, getDescription, getNamespaceURI, getSignaturesForFunction, isInternalModule, isVarDeclared, listFunctions, reset, resolveVariable`

Method Detail

### declareFunction

    public void declareFunction(UserDefinedFunction func)

  Declare a new function. Called by the XQuery compiler when parsing a library module for every function declaration.

  Parameters:
    `func` -

### getFunction

    public UserDefinedFunction getFunction(QName qname,
                                           int arity)

  Try to find the function identified by qname. Returns null if the function is undefined.

  Parameters:
    `qname` -

### declareVariable

    public void declareVariable(QName qname,
                                VariableDeclaration decl)
                         throws XPathException

  Throws:
    `XPathException`

### getSource

    public Source getSource()

  Get the source object this module has been read from. This is required for query access control.

  Returns:
    The source object this module has been read from.

### setSource

    public void setSource(Source source)

  Set the source object this module has been read from. This is required to check the validity of a compiled expression.

  Parameters:
    `source` -

### setContext

    public void setContext(XQueryContext context)

  Set the XQueryContext of this module. This will be a sub-context of the main context as parts of the static context are shared.

  Parameters:
    `context` -

### moduleIsValid

    public boolean moduleIsValid()

  Is this module still valid or should it be reloaded from its source?

Copyright (C) Wolfgang Meier. All rights reserved.