public class StaticQueryContextEE extends StaticQueryContextPE
Constructor and Description |
---|
StaticQueryContextEE(Configuration config)
Create a StaticQueryContext using a given Configuration.
|
StaticQueryContextEE(StaticQueryContext defaultStaticQueryContext) |
Modifier and Type | Method and Description |
---|---|
void |
compileLibrary(java.io.InputStream source,
java.lang.String encoding)
Prepare an XQuery library module for subsequent evaluation.
|
void |
compileLibrary(java.io.Reader source)
Prepare an XQuery library module for subsequent evaluation.
|
void |
compileLibrary(java.lang.String query)
Compile an XQuery library module for subsequent evaluation.
|
void |
copyFrom(StaticQueryContext c) |
java.util.Collection<QueryLibrary> |
getCompiledLibraries() |
QueryLibrary |
getCompiledLibrary(java.lang.String namespace)
Get a previously compiled library module
|
boolean |
isSchemaAware()
Ask whether this query is schema-aware
|
boolean |
isStreaming()
Ask whether the streaming option has been set, that is, whether
subsequent calls on compile() will compile queries to be capable
of executing in streaming mode.
|
void |
setSchemaAware(boolean aware)
Say whether this query is schema-aware
|
void |
setStreaming(boolean option)
Say whether the query should be compiled and evaluated to use streaming.
|
getExtensionFunctionLibrary, setExtensionFunctionLibrary
buildDocument, clearDeclaredGlobalVariables, clearNamespaces, compileQuery, compileQuery, compileQuery, declareCollation, declareCollation, declareDefaultCollation, declareGlobalVariable, declareNamespace, getBaseURI, getCodeInjector, getCollation, getConfiguration, getConstructionMode, getDefaultCollationName, getDefaultElementNamespace, getDefaultFunctionNamespace, getErrorListener, getExternalNamespaceResolver, getLanguageVersion, getModuleLocation, getModuleURIResolver, getNamePool, getNamespaceForPrefix, getRequiredContextItemType, getSystemId, getUserDeclaredNamespaces, isCompileWithTracing, isEmptyLeast, isInheritNamespaces, isPreserveBoundarySpace, isPreserveNamespaces, isUpdating, isUpdatingEnabled, iterateDeclaredGlobalVariables, iterateDeclaredPrefixes, makeExecutable, reset, setBaseURI, setCodeInjector, setCompileWithTracing, setConfiguration, setConstructionMode, setDefaultElementNamespace, setDefaultFunctionNamespace, setEmptyLeast, setErrorListener, setExternalNamespaceResolver, setInheritNamespaces, setLanguageVersion, setModuleLocation, setModuleURIResolver, setPreserveBoundarySpace, setPreserveNamespaces, setRequiredContextItemType, setUpdatingEnabled
public StaticQueryContextEE(Configuration config)
config
- the Saxon Configurationpublic StaticQueryContextEE(StaticQueryContext defaultStaticQueryContext)
public void copyFrom(StaticQueryContext c)
copyFrom
in class StaticQueryContext
public void setSchemaAware(boolean aware)
setSchemaAware
in class StaticQueryContext
aware
- true if this query is schema-awarepublic boolean isSchemaAware()
isSchemaAware
in class StaticQueryContext
public void setStreaming(boolean option)
setStreaming
in class StaticQueryContext
option
- if true, the compiler will attempt to compile a query to be
capable of executing in streaming mode. If the query cannot be streamed,
a compile-time exception is reported. In streaming mode, the source
document is supplied as a stream, and no tree is built in memory. The default
is false. Setting the value to true has the side-effect of setting the required
context item type to "document node"; this is to ensure that expressions such as
//BOOK are streamable.public boolean isStreaming()
isStreaming
in class StaticQueryContext
public void compileLibrary(java.lang.String query) throws XPathException
Note that this interface makes the caller responsible for decoding the query and presenting it as a string of characters. This means it is likely that any encoding specified in the query prolog will be ignored.
compileLibrary
in class StaticQueryContext
query
- The XQuery library module to be compiled, supplied as a string.XPathException
- if the syntax of the expression is wrong,
or if it references namespaces, variables, or functions that have not been declared,
or contains other static errors.public void compileLibrary(java.io.Reader source) throws XPathException, java.io.IOException
Note that this interface makes the Reader responsible for decoding the query and presenting it as a stream of characters. This means it is likely that any encoding specified in the query prolog will be ignored. Also, some implementations of Reader cannot handle a byte order mark.
compileLibrary
in class StaticQueryContext
source
- A Reader giving access to the text of the XQuery query to be compiled.XPathException
- if the syntax of the expression is wrong, or if it references namespaces,
variables, or functions that have not been declared, or any other static error is reported.java.io.IOException
- if a failure occurs reading the supplied input.public void compileLibrary(java.io.InputStream source, java.lang.String encoding) throws XPathException, java.io.IOException
compileLibrary
in class StaticQueryContext
source
- An InputStream giving access to the text of the XQuery query to be compiled, as a stream
of octetsencoding
- The encoding used to translate characters to octets in the query source. The parameter
may be null: in this case the query parser attempts to infer the encoding by inspecting the source,
and if that fails, it assumes UTF-8 encodingXPathException
- if the syntax of the expression is wrong, or if it references namespaces,
variables, or functions that have not been declared, or any other static error is reported.java.io.IOException
- if a failure occurs reading the supplied input.public QueryLibrary getCompiledLibrary(java.lang.String namespace)
getCompiledLibrary
in class StaticQueryContext
namespace
- the module namespacepublic java.util.Collection<QueryLibrary> getCompiledLibraries()
getCompiledLibraries
in class StaticQueryContext
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.