Xalan-C++ API Reference  1.12.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
xalanc::ExtensionFunctionHandler Class Reference

Class handling an extension namespace for XPath. More...

#include <xalanc/XSLT/ExtensionFunctionHandler.hpp>

Inheritance diagram for xalanc::ExtensionFunctionHandler:
[legend]
Collaboration diagram for xalanc::ExtensionFunctionHandler:
[legend]

Public Types

typedef XalanVector< void * > ArgVectorType
 Vector of pointers to function arguments. More...
 
typedef XalanSet< XalanDOMStringStringSetType
 

Public Member Functions

 ExtensionFunctionHandler (const XalanDOMString &namespaceUri, MemoryManager &theManager)
 Construct a new extension namespace handler for a given extension NS. More...
 
 ExtensionFunctionHandler (MemoryManager &theManager, const XalanDOMString &namespaceUri, const XalanDOMString &funcNames, const XalanDOMString &lang, const XalanDOMString &srcURL, const XalanDOMString &scriptSrc)
 Construct a new extension namespace handler given all the information needed. More...
 
virtual ~ExtensionFunctionHandler ()
 
MemoryManager & getMemoryManager ()
 
virtual void setFunctions (const XalanDOMString &funcNames)
 Set function local parts of extension NS. More...
 
virtual void setScript (const XalanDOMString &lang, const XalanDOMString &srcURL, const XalanDOMString &scriptSrc)
 Set the script data for this extension NS. More...
 
virtual bool isFunctionAvailable (const XalanDOMString &function) const
 Tests whether a certain function name is known within this namespace. More...
 
virtual XObjectPtr callFunction (const XalanDOMString &funcName, const ArgVectorType &args)
 Process a call to a function. More...
 

Protected Member Functions

virtual void startupComponent ()
 Start the component up by executing any script that needs to run at startup time. More...
 

Protected Attributes

XalanDOMString m_namespaceUri
 
XalanDOMString m_scriptLang
 
XalanDOMString m_scriptSrc
 
XalanDOMString m_scriptSrcURL
 
void * m_javaObject
 
StringSetType m_functions
 
bool m_componentStarted
 

Static Protected Attributes

static const XalanDOMChar s_tokenDelimiterCharacters []
 

Detailed Description

Class handling an extension namespace for XPath.

Provides functions to test a function's existence and call a function

Definition at line 58 of file ExtensionFunctionHandler.hpp.

Member Typedef Documentation

◆ ArgVectorType

Vector of pointers to function arguments.

Definition at line 140 of file ExtensionFunctionHandler.hpp.

◆ StringSetType

Definition at line 142 of file ExtensionFunctionHandler.hpp.

Constructor & Destructor Documentation

◆ ExtensionFunctionHandler() [1/2]

xalanc::ExtensionFunctionHandler::ExtensionFunctionHandler ( const XalanDOMString namespaceUri,
MemoryManager &  theManager 
)

Construct a new extension namespace handler for a given extension NS.

This doesn't do anything - just hang on to the namespace URI.

Parameters
namespaceUrithe extension namespace URI that I'm implementing

◆ ExtensionFunctionHandler() [2/2]

xalanc::ExtensionFunctionHandler::ExtensionFunctionHandler ( MemoryManager &  theManager,
const XalanDOMString namespaceUri,
const XalanDOMString funcNames,
const XalanDOMString lang,
const XalanDOMString srcURL,
const XalanDOMString scriptSrc 
)

Construct a new extension namespace handler given all the information needed.

Parameters
namespaceUrithe extension namespace URI that I'm implementing
funcNamesstring containing list of functions of extension NS
langlanguage of code implementing the extension
srcURLvalue of src attribute (if any) - treated as a URL or a classname depending on the value of lang. If srcURL is not null, then scriptSrc is ignored.
scriptSrcthe actual script code (if any)

◆ ~ExtensionFunctionHandler()

virtual xalanc::ExtensionFunctionHandler::~ExtensionFunctionHandler ( )
virtual

Member Function Documentation

◆ callFunction()

virtual XObjectPtr xalanc::ExtensionFunctionHandler::callFunction ( const XalanDOMString funcName,
const ArgVectorType args 
)
virtual

Process a call to a function.

Parameters
funcNameFunction name.
argsThe arguments of the function call.
Returns
the return value of the function evaluation.
Exceptions
XSLProcessorExceptionthrown if something goes wrong while running the extension handler.
MalformedURLExceptionif loading trouble
FileNotFoundExceptionif loading trouble
IOExceptionif loading trouble
SAXExceptionif parsing trouble

◆ getMemoryManager()

MemoryManager& xalanc::ExtensionFunctionHandler::getMemoryManager ( )
inline

Definition at line 97 of file ExtensionFunctionHandler.hpp.

◆ isFunctionAvailable()

virtual bool xalanc::ExtensionFunctionHandler::isFunctionAvailable ( const XalanDOMString function) const
virtual

Tests whether a certain function name is known within this namespace.

Parameters
functionname of the function being tested
Returns
true if its known, false if not.

◆ setFunctions()

virtual void xalanc::ExtensionFunctionHandler::setFunctions ( const XalanDOMString funcNames)
virtual

Set function local parts of extension NS.

Parameters
functionswhitespace separated list of function names defined by this extension namespace.

Reimplemented in xalanc::ExtensionNSHandler.

◆ setScript()

virtual void xalanc::ExtensionFunctionHandler::setScript ( const XalanDOMString lang,
const XalanDOMString srcURL,
const XalanDOMString scriptSrc 
)
virtual

Set the script data for this extension NS.

If srcURL is !null then the script body is read from that URL. If not the scriptSrc is used as the src. This method does not actually execute anything - that's done when the component is first hit by the user by an element or a function call.

Parameters
langlanguage of the script.
srcURLvalue of src attribute (if any) - treated as a URL or a classname depending on the value of lang. If srcURL is not null, then scriptSrc is ignored.
scriptSrcthe actual script code (if any)

Reimplemented in xalanc::ExtensionNSHandler.

◆ startupComponent()

virtual void xalanc::ExtensionFunctionHandler::startupComponent ( )
protectedvirtual

Start the component up by executing any script that needs to run at startup time.

This needs to happen before any functions can be called on the component.

Exceptions
XPathProcessorExceptionif something bad happens.

Reimplemented in xalanc::ExtensionNSHandler.

Member Data Documentation

◆ m_componentStarted

bool xalanc::ExtensionFunctionHandler::m_componentStarted
protected

Definition at line 178 of file ExtensionFunctionHandler.hpp.

◆ m_functions

StringSetType xalanc::ExtensionFunctionHandler::m_functions
protected

Definition at line 174 of file ExtensionFunctionHandler.hpp.

◆ m_javaObject

void* xalanc::ExtensionFunctionHandler::m_javaObject
protected

Definition at line 172 of file ExtensionFunctionHandler.hpp.

◆ m_namespaceUri

XalanDOMString xalanc::ExtensionFunctionHandler::m_namespaceUri
protected

Definition at line 167 of file ExtensionFunctionHandler.hpp.

◆ m_scriptLang

XalanDOMString xalanc::ExtensionFunctionHandler::m_scriptLang
protected

Definition at line 168 of file ExtensionFunctionHandler.hpp.

◆ m_scriptSrc

XalanDOMString xalanc::ExtensionFunctionHandler::m_scriptSrc
protected

Definition at line 169 of file ExtensionFunctionHandler.hpp.

◆ m_scriptSrcURL

XalanDOMString xalanc::ExtensionFunctionHandler::m_scriptSrcURL
protected

Definition at line 170 of file ExtensionFunctionHandler.hpp.

◆ s_tokenDelimiterCharacters

const XalanDOMChar xalanc::ExtensionFunctionHandler::s_tokenDelimiterCharacters[]
staticprotected

Definition at line 192 of file ExtensionFunctionHandler.hpp.


The documentation for this class was generated from the following file: