## Xalan-C++ API Documentation

### The Xalan C++ XSLT Processor Version 1.10

Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# ExtensionFunctionHandler Class Reference

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

`#include <ExtensionFunctionHandler.hpp>`

Inheritance diagram for ExtensionFunctionHandler:

[legend]
Collaboration diagram for ExtensionFunctionHandler:

[legend]
List of all members.

## Public Types

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

## Public Methods

- ExtensionFunctionHandler (const XalanDOMString &namespaceUri, MemoryManagerType &theManager)
    Construct a new extension namespace handler for a given extension NS. More...
- ExtensionFunctionHandler (MemoryManagerType &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 ()
- MemoryManagerType& 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 Methods

- 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

- 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

Author:
  Sanjiva Weerawarana (sanjiva@watson.ibm.com)

## Member Typedef Documentation

typedef XalanVector< void *> ExtensionFunctionHandler::ArgVectorType

| Vector of pointers to function arguments.

typedef XalanSet< XalanDOMString > ExtensionFunctionHandler::StringSetType<XalanDOMString>

## Constructor & Destructor Documentation

ExtensionFunctionHandler::ExtensionFunctionHandler ( | const XalanDOMString & namespaceUri,
| MemoryManagerType & 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:
  namespaceUri | the extension namespace URI that I'm implementing

ExtensionFunctionHandler::ExtensionFunctionHandler ( | MemoryManagerType & 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:
  namespaceUri | the extension namespace URI that I'm implementing
  funcNames | string containing list of functions of extension NS
  lang | language of code implementing the extension
  srcURL | value 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.
  scriptSrc | the actual script code (if any)

ExtensionFunctionHandler::~ExtensionFunctionHandler ( | )`[virtual]`

## Member Function Documentation

XObjectPtr ExtensionFunctionHandler::callFunction ( | const XalanDOMString & funcName,
| const ArgVectorType & args )`[virtual]`

  | Process a call to a function. Parameters:
  funcName | Function name.
  args | The arguments of the function call.
  Returns: the return value of the function evaluation. Exceptions:
  XSLProcessorException | thrown if something goes wrong while running the extension handler.
  MalformedURLException | if loading trouble
  FileNotFoundException | if loading trouble
  IOException | if loading trouble
  SAXException | if parsing trouble

MemoryManagerType & ExtensionFunctionHandler::getMemoryManager ( | )

bool ExtensionFunctionHandler::isFunctionAvailable ( | const XalanDOMString & function ) const`[virtual]`

  | Tests whether a certain function name is known within this namespace. Parameters:
  function | name of the function being tested
Returns: true if its known, false if not.

void ExtensionFunctionHandler::setFunctions ( | const XalanDOMString & funcNames )`[virtual]`

  | Set function local parts of extension NS. Parameters:
  functions | whitespace separated list of function names defined by this extension namespace.
Reimplemented in ExtensionNSHandler.

void 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:
  lang | language of the script.
  srcURL | value 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.
  scriptSrc | the actual script code (if any)
Reimplemented in ExtensionNSHandler.

void ExtensionFunctionHandler::startupComponent ( | )`[protected, virtual]`

  | 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:
  XPathProcessorException | if something bad happens.
Reimplemented in ExtensionNSHandler.

## Member Data Documentation

bool ExtensionFunctionHandler::m_componentStarted`[protected]`

StringSetType ExtensionFunctionHandler::m_functions`[protected]`

void * ExtensionFunctionHandler::m_javaObject`[protected]`

XalanDOMString ExtensionFunctionHandler::m_namespaceUri`[protected]`

XalanDOMString ExtensionFunctionHandler::m_scriptLang`[protected]`

XalanDOMString ExtensionFunctionHandler::m_scriptSrc`[protected]`

XalanDOMString ExtensionFunctionHandler::m_scriptSrcURL`[protected]`

const XalanDOMChar ExtensionFunctionHandler::s_tokenDelimiterCharacters`[static, protected]`

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

- ExtensionFunctionHandler.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.10 Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.