> The XQuery Processor
#include <zorba/static_context.h>


Public Member Functions | |
| virtual bool | addCollation (const String &aURI)=0 |
| Adds a collation URI. | |
| virtual bool | addNamespace (const String &aPrefix, const String &aURI)=0 |
| Add a pair (prefix, URI) to the statically known namespaces that are available during query compilation. | |
| void | addReference () const |
| virtual bool | containsFunction (const String &aFnNameUri, const String &aFnNameLocal, int arity) const =0 |
| Check if a function with the given name and arity are registered in the context. | |
| virtual StaticContext_t | createChildContext () const =0 |
| Create a child static context, i.e. | |
| virtual void | disableFunction (const Item &aQName, int arity)=0 |
| virtual void | disableFunction (const Function_t &aFunction)=0 |
| virtual void | findFunctions (const Item &aQName, std::vector< Function_t > &aFunctions) const =0 |
| virtual void | free () |
| virtual String | getBaseURI () const =0 |
| Get the base URI. | |
| virtual boundary_space_mode_t | getBoundarySpacePolicy () const =0 |
| Get the boundary space policy. | |
| virtual TypeIdentifier_t | getCollectionType (const String &aCollectionUri) const =0 |
| Get the type of a statically known collection. | |
| virtual CollectionURIResolver * | getCollectionURIResolver () const =0 |
| virtual construction_mode_t | getConstructionMode () const =0 |
| Get the construction mode. | |
| virtual TypeIdentifier_t | getContextItemStaticType () const =0 |
| Fetch the type of the context item. | |
| virtual void | getCopyNamespacesMode (preserve_mode_t &aPreserve, inherit_mode_t &aInherit) const =0 |
| Get the copy namespace mode. | |
| virtual String | getDefaultCollation () const =0 |
| Get the URI of the default collation. | |
| virtual String | getDefaultElementAndTypeNamespace () const =0 |
| Get the default element and type namespace URI. | |
| virtual String | getDefaultFunctionNamespace () const =0 |
| Get the default function namespace. | |
| virtual order_empty_mode_t | getDefaultOrderForEmptySequences () const =0 |
| Get the default order for the empty sequence. | |
| virtual TypeIdentifier_t | getDocumentType (const String &aDocUri) const =0 |
| Get the type of a statically known document. | |
| virtual DocumentURIResolver * | getDocumentURIResolver ()=0 |
| virtual ModuleURIResolver * | getModuleURIResolver () const =0 |
| virtual String | getNamespaceURIByPrefix (const String &aPrefix) const =0 |
| Get the namespace URI for a given prefix. | |
| virtual ordering_mode_t | getOrderingMode () const =0 |
| Get the ordering mode. | |
| long | getRefCount () const |
| virtual bool | getRevalidationEnabled () const =0 |
| virtual SchemaURIResolver * | getSchemaURIResolver () const =0 |
| virtual xpath1_0compatib_mode_t | getXPath1_0CompatibMode () const =0 |
| Get the XPath 1.0 compatibility mode. | |
| virtual bool | registerStatelessExternalFunction (StatelessExternalFunction *aExternalFunction)=0 |
| Register a stateless external function. | |
| void | removeReference () |
| virtual bool | setBaseURI (const String &aBaseURI)=0 |
| Set the base URI. | |
| virtual bool | setBoundarySpacePolicy (boundary_space_mode_t aMode)=0 |
| Set the boundary space policy. | |
| virtual void | setCollectionType (const String &aCollectionUri, TypeIdentifier_t type)=0 |
| Set the type of a statically known collection. | |
| virtual void | setCollectionURIResolver (CollectionURIResolver *aCollectionUriResolver)=0 |
| virtual bool | setConstructionMode (construction_mode_t aMode)=0 |
| Set the construction mode. | |
| virtual void | setContextItemStaticType (TypeIdentifier_t type)=0 |
| Set the type of the context item. | |
| virtual bool | setCopyNamespacesMode (preserve_mode_t aPreserve, inherit_mode_t aInherit)=0 |
| Set the copy namespace mode. | |
| virtual bool | setDefaultCollation (const String &aURI)=0 |
| Set the URI of the default collation. | |
| virtual bool | setDefaultElementAndTypeNamespace (const String &aURI)=0 |
| Set the default element and type namespace (see http://www.w3.org/TR/xquery/#static_context). | |
| virtual bool | setDefaultFunctionNamespace (const String &aURI)=0 |
| Set the default functionnamespace (see http://www.w3.org/TR/xquery/#static_context). | |
| virtual bool | setDefaultOrderForEmptySequences (order_empty_mode_t aMode)=0 |
| Set the default order for the empty sequence. | |
| virtual void | setDocumentType (const String &aDocUri, TypeIdentifier_t type)=0 |
| Set the type of a statically known document. | |
| virtual void | setDocumentURIResolver (DocumentURIResolver *aDocumentURIResolver)=0 |
| virtual void | setModuleURIResolver (ModuleURIResolver *aModuleUriResolver)=0 |
| virtual bool | setOrderingMode (ordering_mode_t aMode)=0 |
| Set the ordering mode. | |
| virtual bool | setRevalidationEnabled (bool enabled)=0 |
| virtual void | setSchemaURIResolver (SchemaURIResolver *aSchemaUriResolver)=0 |
| virtual bool | setXPath1_0CompatibMode (xpath1_0compatib_mode_t aMode)=0 |
| Set the XPath 1.0 compatibility mode. | |
| virtual | ~StaticContext () |
| Destructor. | |
Protected Attributes | |
| unsigned int | theRefCount |
This class contains the information that is defined in the XQuery specification (see http://www.w3.org/TR/xquery/#static_context).
A StaticContext can be created by calling Zorba::createStaticContext and then be passed to the Zorba::compileQuery or XQuery::compile functions. If no static context has been passed to any of these functions, a default static context is used. It can be accessed by calling XQuery::getStaticContext on a compiled XQuery object.
Note: This class is reference counted. When writing multi-threaded clients, it is the responibility of the client code to synchronize assignments to the SmartPtr holding this object.
Definition at line 44 of file static_context.h.
| virtual zorba::StaticContext::~StaticContext | ( | ) | [inline, virtual] |
| virtual bool zorba::StaticContext::addCollation | ( | const String & | aURI | ) | [pure virtual] |
Adds a collation URI.
The URI specifies the locale and collation strength of the collation that is added. A valid collation URI must begin with http://www.flworfound.org/collations/. This prefix is followed by a collation strength (i.e. PRIMARY, SECONDARY, TERTIARY, QUATTERNARY, or IDENTICAL) followed by a '/'. After the strength a lower-case two- or three-letter ISO-639 language code must follow. The URI may end with an upper-case two-letter ISO-3166. For example, http://www.flworfound.org/collations/PRIMARY/en/US specifies an english language with US begin the country..
Internally, ICU is used for comparing strings. For detailed description see http://www.icu-project.org/apiref/icu4c/classCollator.html and http://www.icu-project.org/apiref/icu4c/classLocale.html
| aURI | the URI of the collation. |
| ZorbaException | if an error occured. |
| virtual bool zorba::StaticContext::addNamespace | ( | const String & | aPrefix, | |
| const String & | aURI | |||
| ) | [pure virtual] |
Add a pair (prefix, URI) to the statically known namespaces that are available during query compilation.
See http://www.w3.org/TR/xquery/#static_context.
| ZorbaException | if an error occures. |
| void zorba::SmartObject::addReference | ( | ) | const [inline, inherited] |
Definition at line 39 of file smart_ptr.h.
| virtual bool zorba::StaticContext::containsFunction | ( | const String & | aFnNameUri, | |
| const String & | aFnNameLocal, | |||
| int | arity | |||
| ) | const [pure virtual] |
Check if a function with the given name and arity are registered in the context.
| virtual StaticContext_t zorba::StaticContext::createChildContext | ( | ) | const [pure virtual] |
Create a child static context, i.e.
a context with the same information, of the given static context.
A child static context carries the same context as it's parent but can override any information.
| virtual void zorba::StaticContext::disableFunction | ( | const Item & | aQName, | |
| int | arity | |||
| ) | [pure virtual] |
| virtual void zorba::StaticContext::disableFunction | ( | const Function_t & | aFunction | ) | [pure virtual] |
| virtual void zorba::StaticContext::findFunctions | ( | const Item & | aQName, | |
| std::vector< Function_t > & | aFunctions | |||
| ) | const [pure virtual] |
| virtual void zorba::SmartObject::free | ( | ) | [inline, virtual, inherited] |
Definition at line 35 of file smart_ptr.h.
| virtual String zorba::StaticContext::getBaseURI | ( | ) | const [pure virtual] |
| virtual boundary_space_mode_t zorba::StaticContext::getBoundarySpacePolicy | ( | ) | const [pure virtual] |
Get the boundary space policy.
(see http://www.w3.org/TR/xquery/#static_context)
| virtual TypeIdentifier_t zorba::StaticContext::getCollectionType | ( | const String & | aCollectionUri | ) | const [pure virtual] |
Get the type of a statically known collection.
| virtual CollectionURIResolver* zorba::StaticContext::getCollectionURIResolver | ( | ) | const [pure virtual] |
| virtual construction_mode_t zorba::StaticContext::getConstructionMode | ( | ) | const [pure virtual] |
Get the construction mode.
(see http://www.w3.org/TR/xquery/#static_context)
| virtual TypeIdentifier_t zorba::StaticContext::getContextItemStaticType | ( | ) | const [pure virtual] |
Fetch the type of the context item.
| virtual void zorba::StaticContext::getCopyNamespacesMode | ( | preserve_mode_t & | aPreserve, | |
| inherit_mode_t & | aInherit | |||
| ) | const [pure virtual] |
Get the copy namespace mode.
(see http://www.w3.org/TR/xquery/#static_context)
aInherit the inherit mode.
| virtual String zorba::StaticContext::getDefaultCollation | ( | ) | const [pure virtual] |
| virtual String zorba::StaticContext::getDefaultElementAndTypeNamespace | ( | ) | const [pure virtual] |
Get the default element and type namespace URI.
| ZorbaException | if an error occured. |
| virtual String zorba::StaticContext::getDefaultFunctionNamespace | ( | ) | const [pure virtual] |
Get the default function namespace.
| ZorbaException | if an error occured. |
| virtual order_empty_mode_t zorba::StaticContext::getDefaultOrderForEmptySequences | ( | ) | const [pure virtual] |
Get the default order for the empty sequence.
(see http://www.w3.org/TR/xquery/#static_context)
| virtual TypeIdentifier_t zorba::StaticContext::getDocumentType | ( | const String & | aDocUri | ) | const [pure virtual] |
Get the type of a statically known document.
| virtual DocumentURIResolver* zorba::StaticContext::getDocumentURIResolver | ( | ) | [pure virtual] |
| virtual ModuleURIResolver* zorba::StaticContext::getModuleURIResolver | ( | ) | const [pure virtual] |
| virtual String zorba::StaticContext::getNamespaceURIByPrefix | ( | const String & | aPrefix | ) | const [pure virtual] |
Get the namespace URI for a given prefix.
| aPrefix | the prefix for which to retrieve the namespace URI. |
| ZorbaException | if an error occured (e.g. no URI could be found for the given prefix). |
| virtual ordering_mode_t zorba::StaticContext::getOrderingMode | ( | ) | const [pure virtual] |
Get the ordering mode.
(see http://www.w3.org/TR/xquery/#static_context)
| long zorba::SmartObject::getRefCount | ( | ) | const [inline, inherited] |
Definition at line 37 of file smart_ptr.h.
| virtual bool zorba::StaticContext::getRevalidationEnabled | ( | ) | const [pure virtual] |
| virtual SchemaURIResolver* zorba::StaticContext::getSchemaURIResolver | ( | ) | const [pure virtual] |
| virtual xpath1_0compatib_mode_t zorba::StaticContext::getXPath1_0CompatibMode | ( | ) | const [pure virtual] |
Get the XPath 1.0 compatibility mode.
(see http://www.w3.org/TR/xquery/#static_context)
| virtual bool zorba::StaticContext::registerStatelessExternalFunction | ( | StatelessExternalFunction * | aExternalFunction | ) | [pure virtual] |
Register a stateless external function.
Register an external function that can be called within a query. The caller keeps the ownership of the StatelessExternalFunction object passed to this function.
| aExternalFunction | the stateless external function. |
| void zorba::SmartObject::removeReference | ( | ) | [inline, inherited] |
Definition at line 41 of file smart_ptr.h.
| virtual bool zorba::StaticContext::setBaseURI | ( | const String & | aBaseURI | ) | [pure virtual] |
Set the base URI.
(see http://www.w3.org/TR/xquery/#static_context)
| aBaseURI | the base URI as String. |
| virtual bool zorba::StaticContext::setBoundarySpacePolicy | ( | boundary_space_mode_t | aMode | ) | [pure virtual] |
Set the boundary space policy.
(see http://www.w3.org/TR/xquery/#static_context)
| aMode | the boundary space policy. |
| virtual void zorba::StaticContext::setCollectionType | ( | const String & | aCollectionUri, | |
| TypeIdentifier_t | type | |||
| ) | [pure virtual] |
Set the type of a statically known collection.
| virtual void zorba::StaticContext::setCollectionURIResolver | ( | CollectionURIResolver * | aCollectionUriResolver | ) | [pure virtual] |
| virtual bool zorba::StaticContext::setConstructionMode | ( | construction_mode_t | aMode | ) | [pure virtual] |
Set the construction mode.
(see http://www.w3.org/TR/xquery/#static_context)
| aMode | the construction mode. |
| virtual void zorba::StaticContext::setContextItemStaticType | ( | TypeIdentifier_t | type | ) | [pure virtual] |
Set the type of the context item.
| virtual bool zorba::StaticContext::setCopyNamespacesMode | ( | preserve_mode_t | aPreserve, | |
| inherit_mode_t | aInherit | |||
| ) | [pure virtual] |
Set the copy namespace mode.
(see http://www.w3.org/TR/xquery/#static_context)
| aPreserve | the preserve mode. | |
| aInherit | the inherit mode. |
| virtual bool zorba::StaticContext::setDefaultCollation | ( | const String & | aURI | ) | [pure virtual] |
Set the URI of the default collation.
(see http://www.w3.org/TR/xquery/#static_context)
| aURI | URI of the default collation. |
| ZorbaException | if an error occured. |
| virtual bool zorba::StaticContext::setDefaultElementAndTypeNamespace | ( | const String & | aURI | ) | [pure virtual] |
Set the default element and type namespace (see http://www.w3.org/TR/xquery/#static_context).
| aURI | of the default element and type namespace URI. |
| ZorbaException | if an error occured. |
| virtual bool zorba::StaticContext::setDefaultFunctionNamespace | ( | const String & | aURI | ) | [pure virtual] |
Set the default functionnamespace (see http://www.w3.org/TR/xquery/#static_context).
| aURI | of the default function namespace. |
| ZorbaException | if an error occured. |
| virtual bool zorba::StaticContext::setDefaultOrderForEmptySequences | ( | order_empty_mode_t | aMode | ) | [pure virtual] |
Set the default order for the empty sequence.
(see http://www.w3.org/TR/xquery/#static_context)
| aMode | the default order for the empty sequence. |
| virtual void zorba::StaticContext::setDocumentType | ( | const String & | aDocUri, | |
| TypeIdentifier_t | type | |||
| ) | [pure virtual] |
Set the type of a statically known document.
| virtual void zorba::StaticContext::setDocumentURIResolver | ( | DocumentURIResolver * | aDocumentURIResolver | ) | [pure virtual] |
| virtual void zorba::StaticContext::setModuleURIResolver | ( | ModuleURIResolver * | aModuleUriResolver | ) | [pure virtual] |
| virtual bool zorba::StaticContext::setOrderingMode | ( | ordering_mode_t | aMode | ) | [pure virtual] |
Set the ordering mode.
(see http://www.w3.org/TR/xquery/#static_context)
| aMode | the ordering mode. |
| virtual bool zorba::StaticContext::setRevalidationEnabled | ( | bool | enabled | ) | [pure virtual] |
| virtual void zorba::StaticContext::setSchemaURIResolver | ( | SchemaURIResolver * | aSchemaUriResolver | ) | [pure virtual] |
| virtual bool zorba::StaticContext::setXPath1_0CompatibMode | ( | xpath1_0compatib_mode_t | aMode | ) | [pure virtual] |
Set the XPath 1.0 compatibility mode.
(see http://www.w3.org/TR/xquery/#static_context)
| aMode | the XPath 1.0 compatibility mode. |
unsigned int zorba::SmartObject::theRefCount [mutable, protected, inherited] |
Definition at line 26 of file smart_ptr.h.