20#ifndef _STATICCONTEXT_HPP
21#define _STATICCONTEXT_HPP
23#include <xqilla/framework/XQillaExport.hpp>
44class XQillaNSResolver;
48typedef std::vector<XQUserFunction*, XQillaAllocator<XQUserFunction*> >
UserFunctions;
50XERCES_CPP_NAMESPACE_BEGIN
52class DOMXPathNSResolver;
53class XMLEntityResolver;
54XERCES_CPP_NAMESPACE_END
57class XQILLA_API
StaticContext :
public XERCES_CPP_NAMESPACE_QUALIFIER XMemory
67 CONSTRUCTION_MODE_STRIP
72 FLWOR_ORDER_EMPTY_LEAST
86 XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::fgMemoryManager)
const = 0;
88 XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::fgMemoryManager)
const = 0;
91 size_t contextPosition,
94 const XERCES_CPP_NAMESPACE_QUALIFIER DOMXPathNSResolver *nsResolver,
95 const XMLCh *defaultElementNS,
96 XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *memMgr =
97 XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::fgMemoryManager)
const = 0;
122 virtual const XERCES_CPP_NAMESPACE_QUALIFIER DOMXPathNSResolver*
getNSResolver()
const = 0;
130 virtual void setNSResolver(
const XERCES_CPP_NAMESPACE_QUALIFIER DOMXPathNSResolver* resolver) = 0;
157 virtual bool isTypeOrDerivedFromType(
const XMLCh*
const uri,
const XMLCh*
const typeName,
const XMLCh*
const uriToCheck,
const XMLCh*
const typeNameToCheck)
const = 0;
std::vector< const XMLCh *, XQillaAllocator< const XMLCh * > > VectorOfStrings
Definition: DocumentCache.hpp:37
std::vector< XQUserFunction *, XQillaAllocator< XQUserFunction * > > UserFunctions
Definition: StaticContext.hpp:48
std::vector< ASTNode *, XQillaAllocator< ASTNode * > > VectorOfASTNodes
Definition: StaticContext.hpp:47
Definition: Collation.hpp:30
Expression Context is a storage for contexts.
Definition: DocumentCache.hpp:53
ValidationMode
Definition: DocumentCache.hpp:58
The execution time dynamic context interface.
Definition: DynamicContext.hpp:39
Definition: ExternalFunctionResolver.hpp:28
Definition: ExternalFunction.hpp:33
Definition: ItemFactory.hpp:51
A class that gives records a location in the query.
Definition: LocationInfo.hpp:30
A class used to listen for warnings or trace information.
Definition: MessageListener.hpp:33
Definition: ModuleResolver.hpp:27
The parse time static context interface.
Definition: StaticContext.hpp:58
virtual void setNamespaceBinding(const XMLCh *prefix, const XMLCh *uri)=0
Binds a prefix to a namespace URI.
virtual const UserFunctions & getTemplateRules() const =0
Return a vector of all the templates with patterns.
virtual FTCaseOption getFTCase()=0
virtual bool getPreserveNamespaces() const =0
Get the policy for namespace copy.
virtual ExternalFunctionResolver * getExternalFunctionResolver() const =0
Returns the external function resolver currently set.
virtual void setMessageListener(MessageListener *listener)=0
Set the listener for warning and trace messages.
virtual const StaticType & getContextItemType() const =0
Get the static type of the context item.
virtual DynamicContext * createDebugQueryContext(const Item::Ptr &contextItem, size_t contextPosition, size_t contextSize, const VariableStore *variables, const xercesc::DOMXPathNSResolver *nsResolver, const XMLCh *defaultElementNS, xercesc::MemoryManager *memMgr=xercesc::XMLPlatformUtils::fgMemoryManager) const =0
virtual ModuleResolver * getModuleResolver() const =0
Returns the module resolver currently set.
virtual NodeSetOrdering getNodeSetOrdering() const =0
Return the ordering method for node sets.
virtual FLWOROrderingMode getDefaultFLWOROrderingMode() const =0
Return the default ordering mode for FLWOR blocks.
virtual DocumentCache * getDocumentCache() const =0
retrieve the repository for the grammars
virtual void setProjection(bool enabled)=0
Sets whether document projection is enabled.
virtual const ExternalFunction * lookUpExternalFunction(const XMLCh *uri, const XMLCh *name, size_t numArgs) const =0
returns an external function implementation for the given uri and localname
virtual VariableTypeStore * getVariableTypeStore()=0
get the variable type store
virtual void setDocumentCache(DocumentCache *docCache)=0
sets the repository for the grammars
virtual ASTNode * lookUpFunction(const XMLCh *uri, const XMLCh *name, const VectorOfASTNodes &v, const LocationInfo *location=0) const =0
returns a function object with the given uri, localname and number of arguments triple
virtual void setContextItemType(const StaticType &st)=0
Set the static type of the context item.
virtual void setFTCase(FTCaseOption option)=0
Set default full text query case option.
virtual const XMLCh * getBaseURI() const =0
Return the base URI.
virtual XPath2MemoryManager * getMemoryManager() const =0
Get the memory manager.
virtual bool getXPath1CompatibilityMode() const =0
Get the current XPath 1.0 compatibility mode.
virtual bool getDoLintWarnings() const =0
virtual DocumentCache::ValidationMode getRevalidationMode() const =0
Get the revalidation mode.
virtual const XMLCh * getDefaultFuncNS() const =0
Return the default namespace for functions.
virtual Collation * getCollation(const XMLCh *const URI, const LocationInfo *location=0) const =0
Get the implementation for the specified collation.
virtual void setDefaultFLWOROrderingMode(FLWOROrderingMode newMode)=0
Set the default ordering mode for FLWOR blocks.
virtual void setInheritNamespaces(bool value)=0
Set the policy for namespace inheritance.
virtual void removeCustomFunction(FuncFactory *func)=0
removes a custom function to the function table
virtual VectorOfStrings * resolveModuleURI(const XMLCh *uri) const =0
virtual void setXMLEntityResolver(xercesc::XMLEntityResolver *const handler)=0
Sets the XMLEntityResolver that is used by Xerces when it is used to parse documents.
virtual DynamicContext * createDynamicContext(xercesc::MemoryManager *memMgr=xercesc::XMLPlatformUtils::fgMemoryManager) const =0
virtual xercesc::XMLEntityResolver * getXMLEntityResolver() const =0
Returns the entity resolver currently set.
virtual void setDoLintWarnings(bool enabled)=0
virtual void setConstructionMode(ConstructionMode newMode)=0
Set the construction mode.
virtual void setPreserveNamespaces(bool value)=0
Set the policy for namespace copy.
virtual void setPreserveBoundarySpace(bool value)=0
Set the policy for boundary space.
virtual void setExternalFunctionResolver(ExternalFunctionResolver *resolver)=0
Register a callback object for resolving external function implementations.
virtual void setItemFactory(ItemFactory *factory)=0
Sets the ItemFactory for this context.
virtual bool isTypeOrDerivedFromType(const XMLCh *const uri, const XMLCh *const typeName, const XMLCh *const uriToCheck, const XMLCh *const typeNameToCheck) const =0
returns true if the type represented by uri:typename is an instance of uriToCheck:typeNameToCheck
virtual void addExternalFunction(const ExternalFunction *func)=0
adds an external function implementation to the function table
virtual void addCustomFunction(FuncFactory *func)=0
adds a custom function to the function table
virtual Collation * getDefaultCollation(const LocationInfo *location=0) const =0
Get the default collation.
virtual const XMLCh * getPrefixBoundToUri(const XMLCh *uri) const =0
returns the prefix that is bound in uri in the current scope or zero length string otherwise
virtual void setModule(XQQuery *module)=0
Set the module.
virtual void setBaseURI(const XMLCh *newURI)=0
Set the base URI.
virtual void setNSResolver(const xercesc::DOMXPathNSResolver *resolver)=0
Set the NS resolver.
virtual const XMLCh * getUriBoundToPrefix(const XMLCh *prefix, const LocationInfo *location=0) const =0
returns the URI that is bound in prefix in the current scope or zero length string otherwise
virtual const XMLCh * allocateTempVarName(const XMLCh *prefix=0)=0
Return a unique name that can be used for a temporary variable.
virtual void addCollation(Collation *collation)=0
Add a collation.
virtual ~StaticContext()
Definition: StaticContext.hpp:83
virtual void setDefaultCollation(const XMLCh *const URI)=0
Specify which collation is the default one.
virtual bool getPreserveBoundarySpace() const =0
Get the policy for boundary space.
virtual const XQUserFunction * lookUpNamedTemplate(const XMLCh *uri, const XMLCh *name) const =0
look up a template definition by name
ConstructionMode
Definition: StaticContext.hpp:65
@ CONSTRUCTION_MODE_PRESERVE
Definition: StaticContext.hpp:66
virtual bool getProjection() const =0
Gets whether document projection is enabled.
virtual void setDefaultFuncNS(const XMLCh *newNS)=0
Set the default namespace for functions.
virtual void setMemoryManager(XPath2MemoryManager *memMgr)=0
Set the memory manager to the one given.
NodeSetOrdering
Definition: StaticContext.hpp:60
@ ORDERING_ORDERED
Definition: StaticContext.hpp:61
virtual DynamicContext * createModuleContext(xercesc::MemoryManager *memMgr=xercesc::XMLPlatformUtils::fgMemoryManager) const =0
virtual const XMLCh * getDefaultElementAndTypeNS() const =0
get the value of the default namespace for elements and types
virtual const xercesc::DOMXPathNSResolver * getNSResolver() const =0
Get the NS resolver.
virtual XQQuery * getModule() const =0
Get the module.
virtual XQillaConfiguration * getConfiguration() const =0
Returns the configuration object for this context.
virtual MessageListener * getMessageListener() const =0
Gets the listener for warning and trace messages.
virtual ItemFactory * getItemFactory() const =0
Returns the ItemFactory for this context, which is used to create XQilla items and other objects.
virtual void setXPath1CompatibilityMode(bool newMode)=0
Set the current XPath 1.0 compatibility mode.
virtual XQilla::Language getLanguage() const =0
Returns the lanuage that this context is for.
virtual void setDefaultElementAndTypeNS(const XMLCh *newNS)=0
set the value of the default namespace for elements and types
virtual void setModuleResolver(ModuleResolver *resolver)=0
Register a callback object for resolving module URIs.
FLWOROrderingMode
Definition: StaticContext.hpp:70
@ FLWOR_ORDER_EMPTY_GREATEST
Definition: StaticContext.hpp:71
virtual void setRevalidationMode(DocumentCache::ValidationMode mode)=0
Set the revalidation mode.
virtual void setNodeSetOrdering(NodeSetOrdering newOrder)=0
Set the ordering method for node sets.
virtual bool getInheritNamespaces() const =0
Get the policy for namespace inheritance.
virtual void addTemplate(XQUserFunction *tp)=0
adds a template definition to the template tables
virtual void addSchemaLocation(const XMLCh *uri, VectorOfStrings *locations, const LocationInfo *location=0)=0
add the location for the grammar of a specific namespace
virtual ConstructionMode getConstructionMode() const =0
Return the construction mode.
FTCaseOption
Definition: StaticContext.hpp:75
@ CASE_INSENSITIVE
Definition: StaticContext.hpp:77
@ CASE_SENSITIVE
Definition: StaticContext.hpp:78
@ UPPERCASE
Definition: StaticContext.hpp:79
@ NONE
Definition: StaticContext.hpp:76
Class that represents the static type of an expression.
Definition: StaticType.hpp:33
The pure virtual base class for accessing variables at runtime.
Definition: VariableStore.hpp:32
This is the wrapper class for the variable store, which implements the lookup and scoping of simple v...
Definition: VariableTypeStore.hpp:35
Definition: XPath2MemoryManager.hpp:46
Encapsulates a query expression.
Definition: XQQuery.hpp:76
Definition: XQillaConfiguration.hpp:39
Language
Enumeration used to select a language to parse.
Definition: XQilla.hpp:65