Package org.apache.commons.jxpath
Class FunctionLibrary
- java.lang.Object
-
- org.apache.commons.jxpath.FunctionLibrary
-
- All Implemented Interfaces:
Functions
public class FunctionLibrary extends java.lang.Object implements Functions
An object that aggregatesFunctions
objects into a group Functions object. SinceJXPathContext
can only register a single Functions object, FunctionLibrary should always be used to group all Functions objects that need to be registered.- Version:
- $Revision: 652845 $ $Date: 2008-05-02 12:46:46 -0500 (Fri, 02 May 2008) $
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List
allFunctions
private java.util.HashMap
byNamespace
-
Constructor Summary
Constructors Constructor Description FunctionLibrary()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFunctions(Functions functions)
Add functions to the libraryFunction
getFunction(java.lang.String namespace, java.lang.String name, java.lang.Object[] parameters)
Returns a Function, if any, for the specified namespace, name and parameter types.java.util.Set
getUsedNamespaces()
Returns a set containing all namespaces used by the aggregated Functions.private void
prepareCache()
Prepare the cache.void
removeFunctions(Functions functions)
Remove functions from the library.
-
-
-
Method Detail
-
addFunctions
public void addFunctions(Functions functions)
Add functions to the library- Parameters:
functions
- to add
-
removeFunctions
public void removeFunctions(Functions functions)
Remove functions from the library.- Parameters:
functions
- to remove
-
getUsedNamespaces
public java.util.Set getUsedNamespaces()
Returns a set containing all namespaces used by the aggregated Functions.- Specified by:
getUsedNamespaces
in interfaceFunctions
- Returns:
- Set
-
getFunction
public Function getFunction(java.lang.String namespace, java.lang.String name, java.lang.Object[] parameters)
Returns a Function, if any, for the specified namespace, name and parameter types.- Specified by:
getFunction
in interfaceFunctions
- Parameters:
namespace
- function namespacename
- function nameparameters
- parameters- Returns:
- Function found
-
prepareCache
private void prepareCache()
Prepare the cache.
-
-