Qizx/db 2.1 API

com.qizx.api
Interface XQuerySession

All Superinterfaces:
ItemFactory
All Known Subinterfaces:
Library

public interface XQuerySession
extends ItemFactory

Simple XQuery session without access to XML Libraries, used in Qizx/open.


Method Summary
 Expression compileExpression(String xquery)
          Creates an executable Expression by compiling a XQuery script.
 void enableJavaBinding(String className)
          Enables a class for the 'Java Binding' mechanism.
 XQueryContext getContext()
          Access to the default XQuery Context.
 ModuleResolver getModuleResolver()
          Returns the private module resolver defined for the session.
 void setModuleResolver(ModuleResolver resolver)
          Defines a private Module resolver for the session.
 
Methods inherited from interface com.qizx.api.ItemFactory
copySequence, createItem, createItem, createItem, createItem, createItem, createItem, createItem, createSequence, getQName, getQName, getQName, getType
 

Method Detail

getContext

public XQueryContext getContext()
Access to the default XQuery Context. This context is inherited by expressions compiled from this session.

Returns:
the XQuery context used as a basis for compiled expressions.

compileExpression

public Expression compileExpression(String xquery)
                             throws CompilationException
Creates an executable Expression by compiling a XQuery script.

Parameters:
xquery - a string containing a XQuery script.
Returns:
an executable Expression that can be used for several executions. Before an execution, the expression can be prepared by binding values with variables
Throws:
CompilationException - thrown after compilation if parsing or static analysis errors are detected. A CompilationException bears a list of Messages.

setModuleResolver

public void setModuleResolver(ModuleResolver resolver)
Defines a private Module resolver for the session. By default, the Module resolver is defined globally on the XQuerySessionManager or the LibraryManager.

Parameters:
resolver - a Module resolver; if set to null, the default module resolver will then be used for the session

getModuleResolver

public ModuleResolver getModuleResolver()
Returns the private module resolver defined for the session.

Returns:
null if no private module resolver was defined for the session

enableJavaBinding

public void enableJavaBinding(String className)
Enables a class for the 'Java Binding' mechanism.

Attention: the Java Binding mechanism is not enabled by default when using the API. Each Java class has to be enabled specifically. It is possible to enable all classes at once (though not advisable for security reasons) by passing a null name.

Attention: once a class has been enabled, it can no longer be disabled in the same session.

Parameters:
className - fully qualified class name (e.g java.sql.DriverManager). If the value 'null' is used instead of a class name, then all Java to Java extensions are enabled or disabled.

© 2008 Axyana Software