Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


XPathEnvSupportDefault.hpp
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 #if !defined(XPATHENVSUPPORTDEFAULT_HEADER_GUARD_1357924680)
19 #define XPATHENVSUPPORTDEFAULT_HEADER_GUARD_1357924680
20 
21 
22 
23 // Base include file. Must be first.
26 
27 
28 
30 
31 
32 
34 
35 
36 
37 XALAN_CPP_NAMESPACE_BEGIN
38 
39 
40 
43 
44 
45 
47 {
48 public:
49 
53 
54  /**
55  * Perform initialization of statics -- must be called before any
56  * processing occurs. See class XPathInit.
57  */
58  static void
59  initialize(MemoryManager& theManager);
60 
61  /**
62  * Perform termination of statics. See class XPathInit.
63  */
64  static void
66 
67 
68  XPathEnvSupportDefault(MemoryManager& theManager XALAN_DEFAULT_MEMMGR);
69 
70  virtual
72 
73  MemoryManager&
75  {
76  return m_memoryManager;
77  }
78 
79  virtual void
81 
82  virtual void
84  eSource source,
85  eClassification classification,
86  const XalanDOMString& msg,
87  const Locator* locator,
88  const XalanNode* sourceNode);
89 
90  virtual void
92  eSource source,
93  eClassification classification,
94  const XalanDOMString& msg,
95  const XalanNode* sourceNode);
96 
97  // Interfaces to install and uninstall external functions globally.
98  // These calls are not thread-safe, and should happen during
99  // processing.
100 
101  /**
102  * Install an external function in the global space.
103  *
104  * @param theNamespace The namespace for the functionl
105  * @param functionName The name of the function.
106  * @param function The function to install.
107  */
108  static void
110  const XalanDOMString& theNamespace,
111  const XalanDOMString& functionName,
112  const Function& function);
113 
114  /**
115  * Uninstall an external function from the global space.
116  *
117  * @param theNamespace The namespace for the functionl
118  * @param functionName The name of the function.
119  */
120  static void
122  const XalanDOMString& theNamespace,
123  const XalanDOMString& functionName);
124 
125  // Interfaces to install and uninstall external functions in this instance.
126 
127  /**
128  * Install an external function in the local space.
129  *
130  * @param theNamespace The namespace for the functionl
131  * @param functionName The name of the function.
132  * @param function The function to install.
133  */
134  virtual void
136  const XalanDOMString& theNamespace,
137  const XalanDOMString& functionName,
138  const Function& function);
139 
140  /**
141  * Uninstall an external function from the local space.
142  *
143  * @param theNamespace The namespace for the functionl
144  * @param functionName The name of the function.
145  */
146  virtual void
148  const XalanDOMString& theNamespace,
149  const XalanDOMString& functionName);
150 
151 
152  // These interfaces are inherited from XPathEnvSupport...
153 
154  virtual XalanDocument*
156  MemoryManager& theManager,
157  const XalanDOMString& urlString,
158  const XalanDOMString& base,
159  ErrorHandler* theErrorHandler = 0);
160 
161  virtual XalanDocument*
162  getSourceDocument(const XalanDOMString& theURI) const;
163 
164  virtual void
166  const XalanDOMString& theURI,
167  XalanDocument* theDocument);
168 
169  virtual const XalanDOMString&
170  findURIFromDoc(const XalanDocument* owner) const;
171 
172  virtual bool
174  const XalanDOMString& theNamespace,
175  const XalanDOMString& elementName) const;
176 
177  virtual bool
179  const XalanDOMString& theNamespace,
180  const XalanDOMString& functionName) const;
181 
182  virtual XObjectPtr
184  XPathExecutionContext& executionContext,
185  const XalanDOMString& theNamespace,
186  const XalanDOMString& functionName,
187  XalanNode* context,
188  const XObjectArgVectorType& argVec,
189  const Locator* locator) const;
190 
191  virtual void
192  reset();
193 
194  // Delete functor for table cleanup...
196  {
199 
200  NamespaceFunctionTableDeleteFunctor(MemoryManager& theManager);
201  /**
202  * Delete the value object in a map value pair. The value of the pair must
203  * be of pointer type.
204  *
205  * @param thePair key-value pair
206  */
207  void
209 
210  private:
211 
212  MemoryManager& m_memoryManager;
213  };
214 
215 protected:
216 
217  /**
218  * Find an external function.
219  *
220  * @param theNamespace The namespace for the function.
221  * @param functionName The name of the function.
222  * @return a pointer to the function if found, or 0 if not found.
223  */
224  const Function*
226  const XalanDOMString& theNamespace,
227  const XalanDOMString& functionName) const;
228 
229 private:
230 
231  // These are not implemented...
233 
235  operator=(const XPathEnvSupportDefault&);
236 
237  bool
238  operator==(const XPathEnvSupportDefault&) const;
239 
240  /**
241  * Update the supplied function table. If the parameter
242  * function is 0, and a function with the supplied
243  * namespace and name exists in the table, it will be
244  * removed. If function is not 0, and a function with
245  * the supplied namespace and name exists in the table,
246  * it will be replaced with the new function. Otherwise,
247  * the function will be added.
248  *
249  * @param theNamespace The namespace for the functionl
250  * @param functionName The name of the function.
251  * @param function The function to install.
252  */
253  static void
254  updateFunctionTable(
255  NamespaceFunctionTablesType& theTable,
256  const XalanDOMString& theNamespace,
257  const XalanDOMString& functionName,
258  const Function* function);
259 
260  /**
261  * Find an external function in the supplied table.
262  *
263  * @param theTable The table to search.
264  * @param theNamespace The namespace for the function.
265  * @param functionName The name of the function.
266  * @return a pointer to the function if found, or 0 if not found.
267  */
268  const Function*
269  findFunction(
270  const NamespaceFunctionTablesType& theTable,
271  const XalanDOMString& theNamespace,
272  const XalanDOMString& functionName) const;
273 
274  // Data members...
275 
276  SourceDocsTableType m_sourceDocs;
277 
278  NamespaceFunctionTablesType m_externalFunctions;
279 
280  MemoryManager& m_memoryManager;
281 
282  PrintWriter* m_pw;
283 
284  static NamespaceFunctionTablesType s_externalFunctions;
285 
286  static const XalanDOMString s_emptyString;
287 };
288 
289 XALAN_CPP_NAMESPACE_END
290 
291 
292 
293 #endif // XPATHENVSUPPORTDEFAULT_HEADER_GUARD_1357924680
XPathEnvSupportDefault::NamespaceFunctionTableDeleteFunctor::operator()
void operator()(const NamespaceFunctionTablesInnerType::value_type &thePair) const
Delete the value object in a map value pair.
XPathEnvSupportDefault::findURIFromDoc
virtual const XalanDOMString & findURIFromDoc(const XalanDocument *owner) const
Given a DOM Document, tell what URI was used to parse it.
XPathEnvSupportDefault::findFunction
const Function * findFunction(const XalanDOMString &theNamespace, const XalanDOMString &functionName) const
Find an external function.
XPathEnvSupportDefault::parseXML
virtual XalanDocument * parseXML(MemoryManager &theManager, const XalanDOMString &urlString, const XalanDOMString &base, ErrorHandler *theErrorHandler=0)
Provides support for XML parsing service.
ProblemListenerBase::eClassification
eClassification
Definition: ProblemListenerBase.hpp:72
XPathEnvSupportDefault::~XPathEnvSupportDefault
virtual ~XPathEnvSupportDefault()
operator==
bool operator==(const ElemAttributeSet &theLHS, const ElemAttributeSet &theRHS)
Definition: ElemAttributeSet.hpp:111
XalanDocument
Definition: XalanDocument.hpp:37
FunctionTableTypeDefinition
XALAN_CPP_NAMESPACE_BEGIN typedef XalanMap< XalanDOMString, const Function * > FunctionTableTypeDefinition
Definition: XPathEnvSupportDefault.hpp:41
XPathEnvSupportDefault::FunctionTableType
FunctionTableTypeDefinition FunctionTableType
Definition: XPathEnvSupportDefault.hpp:51
XPathEnvSupport.hpp
XALAN_USES_MEMORY_MANAGER
#define XALAN_USES_MEMORY_MANAGER(Type)
Definition: XalanMemoryManagement.hpp:597
XPathEnvSupportDefault::uninstallExternalFunctionLocal
virtual void uninstallExternalFunctionLocal(const XalanDOMString &theNamespace, const XalanDOMString &functionName)
Uninstall an external function from the local space.
XALAN_DEFAULT_MEMMGR
#define XALAN_DEFAULT_MEMMGR
Definition: XalanMemoryManagement.hpp:524
XALAN_XPATH_EXPORT
#define XALAN_XPATH_EXPORT
Definition: XPathDefinitions.hpp:35
XPathEnvSupportDefault
Definition: XPathEnvSupportDefault.hpp:47
XPathEnvSupportDefault::SourceDocsTableType
XalanMap< XalanDOMString, XalanDocument * > SourceDocsTableType
Definition: XPathEnvSupportDefault.hpp:50
DOMStringHelper.hpp
ProblemListenerBase::eSource
eSource
Definition: ProblemListenerBase.hpp:59
XPathExecutionContext
Definition: XPathExecutionContext.hpp:80
XalanMap
Xalan implementation of a hashtable.
Definition: XalanMap.hpp:187
XPathEnvSupportDefault::installExternalFunctionLocal
virtual void installExternalFunctionLocal(const XalanDOMString &theNamespace, const XalanDOMString &functionName, const Function &function)
Install an external function in the local space.
XPathEnvSupportDefault::installExternalFunctionGlobal
static void installExternalFunctionGlobal(const XalanDOMString &theNamespace, const XalanDOMString &functionName, const Function &function)
Install an external function in the global space.
XPathEnvSupportDefault::XPathEnvSupportDefault
XPathEnvSupportDefault(MemoryManager &theManager XALAN_DEFAULT_MEMMGR)
XPathEnvSupportDefault::problem
virtual void problem(eSource source, eClassification classification, const XalanDOMString &msg, const Locator *locator, const XalanNode *sourceNode)
Function that is called when a problem event occurs.
XPathEnvSupportDefault::uninstallExternalFunctionGlobal
static void uninstallExternalFunctionGlobal(const XalanDOMString &theNamespace, const XalanDOMString &functionName)
Uninstall an external function from the global space.
XPathEnvSupport
Definition: XPathEnvSupport.hpp:58
XalanVector< XObjectPtr >
XalanDOMString
Definition: XalanDOMString.hpp:46
XPathEnvSupportDefault::getMemoryManager
MemoryManager & getMemoryManager() const
Definition: XPathEnvSupportDefault.hpp:74
XPathEnvSupportDefault::problem
virtual void problem(eSource source, eClassification classification, const XalanDOMString &msg, const XalanNode *sourceNode)
Function that is called when a problem event occurs.
XObjectPtr
Class to hold XObjectPtr return types.
Definition: XObject.hpp:884
XPathEnvSupportDefault::initialize
static void initialize(MemoryManager &theManager)
Perform initialization of statics – must be called before any processing occurs.
XPathEnvSupportDefault::NamespaceFunctionTablesType
XalanMap< XalanDOMString, FunctionTableType > NamespaceFunctionTablesType
Definition: XPathEnvSupportDefault.hpp:52
XPathEnvSupportDefault::elementAvailable
virtual bool elementAvailable(const XalanDOMString &theNamespace, const XalanDOMString &elementName) const
Determine if an external element is available.
XPathEnvSupportDefault::extFunction
virtual XObjectPtr extFunction(XPathExecutionContext &executionContext, const XalanDOMString &theNamespace, const XalanDOMString &functionName, XalanNode *context, const XObjectArgVectorType &argVec, const Locator *locator) const
Handle an extension function.
XalanMap.hpp
XPathEnvSupportDefault::getSourceDocument
virtual XalanDocument * getSourceDocument(const XalanDOMString &theURI) const
Get the source document for the given URI.
XalanMap< XalanDOMString, FunctionTableType >::value_type
XALAN_STD_QUALIFIER pair< const key_type, data_type > value_type
Definition: XalanMap.hpp:201
XPathEnvSupportDefault::reset
virtual void reset()
Reset the instance.
Function
Definition: Function.hpp:55
XPathEnvSupportDefault::setSourceDocument
virtual void setSourceDocument(const XalanDOMString &theURI, XalanDocument *theDocument)
Associate a document with a given URI.
XPathEnvSupportDefault::NamespaceFunctionTableDeleteFunctor::NamespaceFunctionTableDeleteFunctor
NamespaceFunctionTableDeleteFunctor(MemoryManager &theManager)
XPathEnvSupportDefault::NamespaceFunctionTableDeleteFunctor
Definition: XPathEnvSupportDefault.hpp:196
XPathEnvSupportDefault::NamespaceFunctionTableDeleteFunctor::FunctionTableInnerType
FunctionTableType FunctionTableInnerType
Definition: XPathEnvSupportDefault.hpp:197
XalanNode
Definition: XalanNode.hpp:39
PrintWriter
Definition: PrintWriter.hpp:38
XPathEnvSupportDefault::setPrintWriter
virtual void setPrintWriter(PrintWriter *pw)
XPathEnvSupportDefault::terminate
static void terminate()
Perform termination of statics.
XPathEnvSupportDefault::NamespaceFunctionTableDeleteFunctor::NamespaceFunctionTablesInnerType
NamespaceFunctionTablesType NamespaceFunctionTablesInnerType
Definition: XPathEnvSupportDefault.hpp:198
XPathEnvSupportDefault::functionAvailable
virtual bool functionAvailable(const XalanDOMString &theNamespace, const XalanDOMString &functionName) const
Determine if a function is available.
XPathDefinitions.hpp

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

Xalan-C++ XSLT Processor Version 1.11
Copyright © 1999-2012 The Apache Software Foundation.
All Rights Reserved.

Apache Logo