org.apache.xpath.compiler
Class FunctionTable

java.lang.Object
  extended byorg.apache.xpath.compiler.FunctionTable

public class FunctionTable
extends Object

The function table for XPath.


Field Summary
static int FUNC_BOOLEAN
          The 'boolean()' id.
static int FUNC_CEILING
          The 'ceiling()' id.
static int FUNC_CONCAT
          The 'concat()' id.
static int FUNC_CONTAINS
          The 'contains()' id.
static int FUNC_COUNT
          The 'count()' id.
static int FUNC_CURRENT
          The 'current()' id.
static int FUNC_DOCLOCATION
          The 'document-location()' id (Proprietary).
static int FUNC_EXT_ELEM_AVAILABLE
          The 'element-available()' id (XSLT).
static int FUNC_EXT_FUNCTION_AVAILABLE
          The 'function-available()' id (XSLT).
static int FUNC_FALSE
          The 'false()' id.
static int FUNC_FLOOR
          The 'floor()' id.
static int FUNC_GENERATE_ID
          The 'generate-id()' id.
static int FUNC_ID
          The 'id()' id.
static int FUNC_KEY
          The 'key()' id (XSLT).
static int FUNC_LANG
          The 'lang()' id.
static int FUNC_LAST
          The 'last()' id.
static int FUNC_LOCAL_PART
          The 'local-name()' id.
static int FUNC_NAMESPACE
          The 'namespace-uri()' id.
static int FUNC_NORMALIZE_SPACE
          The 'normalize-space()' id.
static int FUNC_NOT
          The 'not()' id.
static int FUNC_NUMBER
          The 'number()' id.
static int FUNC_POSITION
          The 'position()' id.
static int FUNC_QNAME
          The 'name()' id.
static int FUNC_ROUND
          The 'round()' id.
static int FUNC_STARTS_WITH
          The 'starts-with()' id.
static int FUNC_STRING
          The 'string()' id.
static int FUNC_STRING_LENGTH
          The 'string-length()' id.
static int FUNC_SUBSTRING
          The 'substring()' id.
static int FUNC_SUBSTRING_AFTER
          The 'substring-after()' id.
static int FUNC_SUBSTRING_BEFORE
          The 'substring-before()' id.
static int FUNC_SUM
          The 'sum()' id.
static int FUNC_SYSTEM_PROPERTY
          The 'system-property()' id.
static int FUNC_TRANSLATE
          The 'translate()' id.
static int FUNC_TRUE
          The 'true()' id.
static int FUNC_UNPARSED_ENTITY_URI
          The 'unparsed-entity-uri()' id (XSLT).
(package private) static int m_funcNextFreeIndex
          The index to the next free function index.
static FuncLoader[] m_functions
          The function table.
private static int NUM_ALLOWABLE_ADDINS
          Number of built-in functions that may be added.
private static int NUM_BUILT_IN_FUNCS
          Number of built in functions.
 
Constructor Summary
FunctionTable()
           
 
Method Summary
static Function getFunction(int which)
          Obtain a new Function object from a function ID.
static void installFunction(Expression func, int funcIndex)
          Install a function loader at a specific index.
static int installFunction(String name, Expression func)
          Install a built-in function.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FUNC_CURRENT

public static final int FUNC_CURRENT
The 'current()' id.

See Also:
Constant Field Values

FUNC_LAST

public static final int FUNC_LAST
The 'last()' id.

See Also:
Constant Field Values

FUNC_POSITION

public static final int FUNC_POSITION
The 'position()' id.

See Also:
Constant Field Values

FUNC_COUNT

public static final int FUNC_COUNT
The 'count()' id.

See Also:
Constant Field Values

FUNC_ID

public static final int FUNC_ID
The 'id()' id.

See Also:
Constant Field Values

FUNC_KEY

public static final int FUNC_KEY
The 'key()' id (XSLT).

See Also:
Constant Field Values

FUNC_LOCAL_PART

public static final int FUNC_LOCAL_PART
The 'local-name()' id.

See Also:
Constant Field Values

FUNC_NAMESPACE

public static final int FUNC_NAMESPACE
The 'namespace-uri()' id.

See Also:
Constant Field Values

FUNC_QNAME

public static final int FUNC_QNAME
The 'name()' id.

See Also:
Constant Field Values

FUNC_GENERATE_ID

public static final int FUNC_GENERATE_ID
The 'generate-id()' id.

See Also:
Constant Field Values

FUNC_NOT

public static final int FUNC_NOT
The 'not()' id.

See Also:
Constant Field Values

FUNC_TRUE

public static final int FUNC_TRUE
The 'true()' id.

See Also:
Constant Field Values

FUNC_FALSE

public static final int FUNC_FALSE
The 'false()' id.

See Also:
Constant Field Values

FUNC_BOOLEAN

public static final int FUNC_BOOLEAN
The 'boolean()' id.

See Also:
Constant Field Values

FUNC_NUMBER

public static final int FUNC_NUMBER
The 'number()' id.

See Also:
Constant Field Values

FUNC_FLOOR

public static final int FUNC_FLOOR
The 'floor()' id.

See Also:
Constant Field Values

FUNC_CEILING

public static final int FUNC_CEILING
The 'ceiling()' id.

See Also:
Constant Field Values

FUNC_ROUND

public static final int FUNC_ROUND
The 'round()' id.

See Also:
Constant Field Values

FUNC_SUM

public static final int FUNC_SUM
The 'sum()' id.

See Also:
Constant Field Values

FUNC_STRING

public static final int FUNC_STRING
The 'string()' id.

See Also:
Constant Field Values

FUNC_STARTS_WITH

public static final int FUNC_STARTS_WITH
The 'starts-with()' id.

See Also:
Constant Field Values

FUNC_CONTAINS

public static final int FUNC_CONTAINS
The 'contains()' id.

See Also:
Constant Field Values

FUNC_SUBSTRING_BEFORE

public static final int FUNC_SUBSTRING_BEFORE
The 'substring-before()' id.

See Also:
Constant Field Values

FUNC_SUBSTRING_AFTER

public static final int FUNC_SUBSTRING_AFTER
The 'substring-after()' id.

See Also:
Constant Field Values

FUNC_NORMALIZE_SPACE

public static final int FUNC_NORMALIZE_SPACE
The 'normalize-space()' id.

See Also:
Constant Field Values

FUNC_TRANSLATE

public static final int FUNC_TRANSLATE
The 'translate()' id.

See Also:
Constant Field Values

FUNC_CONCAT

public static final int FUNC_CONCAT
The 'concat()' id.

See Also:
Constant Field Values

FUNC_SUBSTRING

public static final int FUNC_SUBSTRING
The 'substring()' id.

See Also:
Constant Field Values

FUNC_STRING_LENGTH

public static final int FUNC_STRING_LENGTH
The 'string-length()' id.

See Also:
Constant Field Values

FUNC_SYSTEM_PROPERTY

public static final int FUNC_SYSTEM_PROPERTY
The 'system-property()' id.

See Also:
Constant Field Values

FUNC_LANG

public static final int FUNC_LANG
The 'lang()' id.

See Also:
Constant Field Values

FUNC_EXT_FUNCTION_AVAILABLE

public static final int FUNC_EXT_FUNCTION_AVAILABLE
The 'function-available()' id (XSLT).

See Also:
Constant Field Values

FUNC_EXT_ELEM_AVAILABLE

public static final int FUNC_EXT_ELEM_AVAILABLE
The 'element-available()' id (XSLT).

See Also:
Constant Field Values

FUNC_UNPARSED_ENTITY_URI

public static final int FUNC_UNPARSED_ENTITY_URI
The 'unparsed-entity-uri()' id (XSLT).

See Also:
Constant Field Values

FUNC_DOCLOCATION

public static final int FUNC_DOCLOCATION
The 'document-location()' id (Proprietary).

See Also:
Constant Field Values

m_functions

public static FuncLoader[] m_functions
The function table.


NUM_BUILT_IN_FUNCS

private static final int NUM_BUILT_IN_FUNCS
Number of built in functions. Be sure to update this as built-in functions are added.

See Also:
Constant Field Values

NUM_ALLOWABLE_ADDINS

private static final int NUM_ALLOWABLE_ADDINS
Number of built-in functions that may be added.

See Also:
Constant Field Values

m_funcNextFreeIndex

static int m_funcNextFreeIndex
The index to the next free function index.

Constructor Detail

FunctionTable

public FunctionTable()
Method Detail

getFunction

public static Function getFunction(int which)
                            throws javax.xml.transform.TransformerException
Obtain a new Function object from a function ID.

Parameters:
which - The function ID, which may correspond to one of the FUNC_XXX values found in FunctionTable, but may be a value installed by an external module.
Returns:
a a new Function instance.
Throws:
javax.xml.transform.TransformerException - if ClassNotFoundException, IllegalAccessException, or InstantiationException is thrown.

installFunction

public static int installFunction(String name,
                                  Expression func)
Install a built-in function.

Parameters:
name - The unqualified name of the function.
func - A Implementation of an XPath Function object.
Returns:
the position of the function in the internal index.

installFunction

public static void installFunction(Expression func,
                                   int funcIndex)
Install a function loader at a specific index.

Parameters:
func - A Implementation of an XPath Function object.
Returns:
the position of the function in the internal index.