|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.xml_project.morganaxproc.connectors.XQueryConnector
public abstract class XQueryConnector
This class defines an interface for the use of XQuery processors with MorganaXProc
. It
allows you to use any XQuery processor you like in 'p:xquery' by just wrapping an
XQueryConnector
around it.
The interface to XQuery processors comes in two classes:
XQueryConnector
serves as the basic connection to the used
XQuery processor. It holds the basic information of the connector and
is used to set some configuration. The basis task of XQueryConnector
is to create an instance of XQueryExpression
as an executable form
of an XQuery expression in compile()
.
XQueryExpression
is then used to set the dynamic context of
the expression and run it to produce a sequence of nodes from the context item.
Constructor Summary | |
---|---|
XQueryConnector()
|
Method Summary | |
---|---|
abstract void |
addXPathFunction(XPathFunction function)
Adds an user written XPath extension function to the list of visible functions in XQuery |
abstract XQueryExpression |
compile(java.lang.String query,
java.net.URI theURI,
java.lang.String version)
Compiles an XQuery expression into an executable form. |
abstract nu.xom.Document |
getErrorDocument()
Return an xom document with the static and dynamic errors occurred while compiling the XQuery expression. |
abstract java.lang.String |
getInfoString()
Defines an string displayed on the standard output stream the first time, an instance of the connector is generated. |
abstract boolean |
implementsVersion(java.lang.String version)
Checks whether the XQuery processor used in this connector supports a specific version of XQuery. |
static XQueryConnector |
newInstance(java.lang.String className,
java.io.PrintWriter infoWriter,
java.io.PrintStream messageStream)
Creates a new instance of an XQueryConnector using the class the given class name. |
static XQueryConnector |
newInstance(XProcConfiguration config,
java.io.PrintWriter infoWriter,
java.io.PrintStream messageStream)
Creates a new instance of an XQueryConnector using the class defined in XProcConfiguration . |
abstract void |
setModuleURIResolver(ModuleURIResolver resolver)
Sets the resolver for module import. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XQueryConnector()
Method Detail |
---|
public abstract java.lang.String getInfoString()
public abstract boolean implementsVersion(java.lang.String version)
version
- the requested version
true
if this version is supported, otherwise false
public abstract nu.xom.Document getErrorDocument()
compile
returns null to
flag errors while compiling the expression. The behaviour in case of a successful compilation
is not defined.
public abstract void setModuleURIResolver(ModuleURIResolver resolver)
resolver
- the resolver to be used.public abstract void addXPathFunction(XPathFunction function) throws XPathException
function
- the function to add.
XPathException
- if the function cannot be casted.public abstract XQueryExpression compile(java.lang.String query, java.net.URI theURI, java.lang.String version)
query
- the XQuery expressiontheURI
- the baseURI to use for compiling the XQuery expression.version
- the version to use or null for the processors default version
public static final XQueryConnector newInstance(XProcConfiguration config, java.io.PrintWriter infoWriter, java.io.PrintStream messageStream) throws XQueryConnectorException
XProcConfiguration
.
This method is called before the execution of the pipeline by MorganaXProc
.
config
- the XProcConfiguration to use.infoWriter
- the PrintWriter
for messages or null
.messageStream
- the PrintStream
for copyright messages.
XQueryConnectorException
- if any exception occurs in creating the new XQueryConnector
.public static final XQueryConnector newInstance(java.lang.String className, java.io.PrintWriter infoWriter, java.io.PrintStream messageStream) throws XQueryConnectorException
MorganaXProc
.
className
- A class name for the XQueryConnector to create.infoWriter
- the PrintWriter
for messages or null
.messageStream
- the PrintStream
for copyright messages.
XQueryConnectorException
- if any exception occurs in creating the new XQueryConnector
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |