org.apache.xpath.compiler

Class FunctionTable


public class FunctionTable
extends java.lang.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).
static FuncLoader[]
m_functions
The function table.

Method Summary

static Function
getFunction(int which)
Obtain a new Function object from a function ID.
static int
installFunction(String name, Expression func)
Install a built-in function.
static void
installFunction(Expression func, int funcIndex)
Install a function loader at a specific index.

Field Details

FUNC_BOOLEAN

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

Field Value:
14


FUNC_CEILING

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

Field Value:
17


FUNC_CONCAT

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

Field Value:
27


FUNC_CONTAINS

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

Field Value:
22


FUNC_COUNT

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

Field Value:
3


FUNC_CURRENT

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

Field Value:
0


FUNC_DOCLOCATION

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

Field Value:
35


FUNC_EXT_ELEM_AVAILABLE

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

Field Value:
34


FUNC_EXT_FUNCTION_AVAILABLE

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

Field Value:
33


FUNC_FALSE

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

Field Value:
13


FUNC_FLOOR

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

Field Value:
16


FUNC_GENERATE_ID

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

Field Value:
10


FUNC_ID

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

Field Value:
4


FUNC_KEY

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

Field Value:
5


FUNC_LANG

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

Field Value:
32


FUNC_LAST

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

Field Value:
1


FUNC_LOCAL_PART

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

Field Value:
7


FUNC_NAMESPACE

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

Field Value:
8


FUNC_NORMALIZE_SPACE

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

Field Value:
25


FUNC_NOT

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

Field Value:
11


FUNC_NUMBER

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

Field Value:
15


FUNC_POSITION

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

Field Value:
2


FUNC_QNAME

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

Field Value:
9


FUNC_ROUND

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

Field Value:
18


FUNC_STARTS_WITH

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

Field Value:
21


FUNC_STRING

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

Field Value:
20


FUNC_STRING_LENGTH

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

Field Value:
30


FUNC_SUBSTRING

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

Field Value:
29


FUNC_SUBSTRING_AFTER

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

Field Value:
24


FUNC_SUBSTRING_BEFORE

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

Field Value:
23


FUNC_SUM

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

Field Value:
19


FUNC_SYSTEM_PROPERTY

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

Field Value:
31


FUNC_TRANSLATE

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

Field Value:
26


FUNC_TRUE

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

Field Value:
12


FUNC_UNPARSED_ENTITY_URI

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

Field Value:
36


m_functions

public static FuncLoader[] m_functions
The function table.

Method Details

getFunction

public static Function getFunction(int which)
            throws 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:
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.


Copyright B) 2004 Apache XML Project. All Rights Reserved.