Top Description Fields Constructors Methods
com.sun.org.apache.xpath.internal.compiler

public Class FunctionTable

extends Object
Class Inheritance
Imports
com.sun.org.apache.xpath.internal.functions.Function, java.lang.reflect.InvocationTargetException, java.util.HashMap, .Map, javax.xml.transform.TransformerException

The function table for XPath.

Field Summary

Modifier and TypeField and Description
public static final int
FUNC_BOOLEAN

The 'boolean()' id.

public static final int
FUNC_CEILING

The 'ceiling()' id.

public static final int
FUNC_CONCAT

The 'concat()' id.

public static final int
FUNC_CONTAINS

The 'contains()' id.

public static final int
FUNC_COUNT

The 'count()' id.

public static final int
FUNC_CURRENT

The 'current()' id.

public static final int
FUNC_DOCLOCATION

The 'document-location()' id (Proprietary).

public static final int
FUNC_EXT_ELEM_AVAILABLE

The 'element-available()' id (XSLT).

public static final int
FUNC_EXT_FUNCTION_AVAILABLE

The 'function-available()' id (XSLT).

public static final int
FUNC_FALSE

The 'false()' id.

public static final int
FUNC_FLOOR

The 'floor()' id.

public static final int
FUNC_GENERATE_ID

The 'generate-id()' id.

public static final int
FUNC_HERE

The 'here()' id (XML Signature).

public static final int
FUNC_ID

The 'id()' id.

public static final int
FUNC_KEY

The 'key()' id (XSLT).

public static final int
FUNC_LANG

The 'lang()' id.

public static final int
FUNC_LAST

The 'last()' id.

public static final int
FUNC_LOCAL_PART

The 'local-name()' id.

public static final int
FUNC_NAMESPACE

The 'namespace-uri()' id.

public static final int
FUNC_NORMALIZE_SPACE

The 'normalize-space()' id.

public static final int
FUNC_NOT

The 'not()' id.

public static final int
FUNC_NUMBER

The 'number()' id.

public static final int
FUNC_POSITION

The 'position()' id.

public static final int
FUNC_QNAME

The 'name()' id.

public static final int
FUNC_ROUND

The 'round()' id.

public static final int
FUNC_STARTS_WITH

The 'starts-with()' id.

public static final int
FUNC_STRING

The 'string()' id.

public static final int
FUNC_STRING_LENGTH

The 'string-length()' id.

public static final int
FUNC_SUBSTRING

The 'substring()' id.

public static final int
FUNC_SUBSTRING_AFTER

The 'substring-after()' id.

public static final int
FUNC_SUBSTRING_BEFORE

The 'substring-before()' id.

public static final int
FUNC_SUM

The 'sum()' id.

public static final int
FUNC_SYSTEM_PROPERTY

The 'system-property()' id.

public static final int
FUNC_TRANSLATE

The 'translate()' id.

public static final int
FUNC_TRUE

The 'true()' id.

public static final int
FUNC_UNPARSED_ENTITY_URI

The 'unparsed-entity-uri()' id (XSLT).

private int
m_funcNextFreeIndex

The index to the next free function index.

private static final Map<String, Integer>
m_functionID

Table of function name to function ID associations.

private Map<String, Integer>
m_functionID_customer

Table of function name to function ID associations for customized functions

private static Class<?>[]
m_functions

The function table.

private Class<?>[]
m_functions_customer

The function table contains customized functions

private static final int
NUM_ALLOWABLE_ADDINS

Number of built-in functions that may be added.

private static final int
NUM_BUILT_IN_FUNCS

Number of built in functions.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

True if the function can be executed.
functionAvailable
(String
The local name of the function.
methName
)

Tell if a built-in, non-namespaced function is available.

pack-priv Function

Returns:

a a new Function instance.
getFunction
(int
The function ID, which may correspond to one of the FUNC_XXX values found in com.sun.org.apache.xpath.internal.compiler.FunctionTable, but may be a value installed by an external module.
which
)

Obtain a new Function object from a function ID.

pack-priv Integer

Returns:

a function ID, which may correspond to one of the FUNC_XXX values found in com.sun.org.apache.xpath.internal.compiler.FunctionTable, but may be a value installed by an external module.
getFunctionID
(String
the function name in a java.lang.String format.
key
)

Obtain a function ID from a given function name

pack-priv String
getFunctionName(int funcID)

Return the name of the a function in the static table.

public int

Returns:

the position of the function in the internal index.
installFunction
(String
The unqualified name of the function, must not be null
name
,
Class<?>
A Implementation of an XPath Function object.
func
)

Install a built-in function.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

FUNC_BOOLEANback to summary
public static final int FUNC_BOOLEAN

The 'boolean()' id.

FUNC_CEILINGback to summary
public static final int FUNC_CEILING

The 'ceiling()' id.

FUNC_CONCATback to summary
public static final int FUNC_CONCAT

The 'concat()' id.

FUNC_CONTAINSback to summary
public static final int FUNC_CONTAINS

The 'contains()' id.

FUNC_COUNTback to summary
public static final int FUNC_COUNT

The 'count()' id.

FUNC_CURRENTback to summary
public static final int FUNC_CURRENT

The 'current()' id.

FUNC_DOCLOCATIONback to summary
public static final int FUNC_DOCLOCATION

The 'document-location()' id (Proprietary).

FUNC_EXT_ELEM_AVAILABLEback to summary
public static final int FUNC_EXT_ELEM_AVAILABLE

The 'element-available()' id (XSLT).

FUNC_EXT_FUNCTION_AVAILABLEback to summary
public static final int FUNC_EXT_FUNCTION_AVAILABLE

The 'function-available()' id (XSLT).

FUNC_FALSEback to summary
public static final int FUNC_FALSE

The 'false()' id.

FUNC_FLOORback to summary
public static final int FUNC_FLOOR

The 'floor()' id.

FUNC_GENERATE_IDback to summary
public static final int FUNC_GENERATE_ID

The 'generate-id()' id.

FUNC_HEREback to summary
public static final int FUNC_HERE

The 'here()' id (XML Signature).

FUNC_IDback to summary
public static final int FUNC_ID

The 'id()' id.

FUNC_KEYback to summary
public static final int FUNC_KEY

The 'key()' id (XSLT).

FUNC_LANGback to summary
public static final int FUNC_LANG

The 'lang()' id.

FUNC_LASTback to summary
public static final int FUNC_LAST

The 'last()' id.

FUNC_LOCAL_PARTback to summary
public static final int FUNC_LOCAL_PART

The 'local-name()' id.

FUNC_NAMESPACEback to summary
public static final int FUNC_NAMESPACE

The 'namespace-uri()' id.

FUNC_NORMALIZE_SPACEback to summary
public static final int FUNC_NORMALIZE_SPACE

The 'normalize-space()' id.

FUNC_NOTback to summary
public static final int FUNC_NOT

The 'not()' id.

FUNC_NUMBERback to summary
public static final int FUNC_NUMBER

The 'number()' id.

FUNC_POSITIONback to summary
public static final int FUNC_POSITION

The 'position()' id.

FUNC_QNAMEback to summary
public static final int FUNC_QNAME

The 'name()' id.

FUNC_ROUNDback to summary
public static final int FUNC_ROUND

The 'round()' id.

FUNC_STARTS_WITHback to summary
public static final int FUNC_STARTS_WITH

The 'starts-with()' id.

FUNC_STRINGback to summary
public static final int FUNC_STRING

The 'string()' id.

FUNC_STRING_LENGTHback to summary
public static final int FUNC_STRING_LENGTH

The 'string-length()' id.

FUNC_SUBSTRINGback to summary
public static final int FUNC_SUBSTRING

The 'substring()' id.

FUNC_SUBSTRING_AFTERback to summary
public static final int FUNC_SUBSTRING_AFTER

The 'substring-after()' id.

FUNC_SUBSTRING_BEFOREback to summary
public static final int FUNC_SUBSTRING_BEFORE

The 'substring-before()' id.

FUNC_SUMback to summary
public static final int FUNC_SUM

The 'sum()' id.

FUNC_SYSTEM_PROPERTYback to summary
public static final int FUNC_SYSTEM_PROPERTY

The 'system-property()' id.

FUNC_TRANSLATEback to summary
public static final int FUNC_TRANSLATE

The 'translate()' id.

FUNC_TRUEback to summary
public static final int FUNC_TRUE

The 'true()' id.

FUNC_UNPARSED_ENTITY_URIback to summary
public static final int FUNC_UNPARSED_ENTITY_URI

The 'unparsed-entity-uri()' id (XSLT).

m_funcNextFreeIndexback to summary
private int m_funcNextFreeIndex

The index to the next free function index.

m_functionIDback to summary
private static final Map<String, Integer> m_functionID

Table of function name to function ID associations.

m_functionID_customerback to summary
private Map<String, Integer> m_functionID_customer

Table of function name to function ID associations for customized functions

m_functionsback to summary
private static Class<?>[] m_functions

The function table.

m_functions_customerback to summary
private Class<?>[] m_functions_customer

The function table contains customized functions

NUM_ALLOWABLE_ADDINSback to summary
private static final int NUM_ALLOWABLE_ADDINS

Number of built-in functions that may be added.

NUM_BUILT_IN_FUNCSback to summary
private static final int NUM_BUILT_IN_FUNCS

Number of built in functions. Be sure to update this as built-in functions are added.

Constructor Detail

FunctionTableback to summary
public FunctionTable()

Method Detail

functionAvailableback to summary
public boolean functionAvailable(String methName)

Tell if a built-in, non-namespaced function is available.

Parameters
methName:String

The local name of the function.

Returns:boolean

True if the function can be executed.

getFunctionback to summary
pack-priv Function getFunction(int which) throws TransformerException

Obtain a new Function object from a function ID.

Parameters
which:int

The function ID, which may correspond to one of the FUNC_XXX values found in com.sun.org.apache.xpath.internal.compiler.FunctionTable, but may be a value installed by an external module.

Returns:Function

a a new Function instance.

Exceptions
TransformerException:
if ClassNotFoundException, IllegalAccessException, or InstantiationException is thrown.
getFunctionIDback to summary
pack-priv Integer getFunctionID(String key)

Obtain a function ID from a given function name

Parameters
key:String

the function name in a java.lang.String format.

Returns:Integer

a function ID, which may correspond to one of the FUNC_XXX values found in com.sun.org.apache.xpath.internal.compiler.FunctionTable, but may be a value installed by an external module.

getFunctionNameback to summary
pack-priv String getFunctionName(int funcID)

Return the name of the a function in the static table. Needed to avoid making the table publicly available.

installFunctionback to summary
public int installFunction(String name, Class<?> func)

Install a built-in function.

Parameters
name:String

The unqualified name of the function, must not be null

func:Class<?>

A Implementation of an XPath Function object.

Returns:int

the position of the function in the internal index.