org.apache.commons.jxpath
Class FunctionLibrary

java.lang.Object
  extended byorg.apache.commons.jxpath.FunctionLibrary
All Implemented Interfaces:
Functions

public class FunctionLibrary
extends java.lang.Object
implements Functions

An object that aggregates Functions objects into a group Functions object. Since JXPathContext can only register a single Functions object, FunctionLibrary should always be used to group all Functions objects that need to be registered.

Version:
$Revision: 1.5 $ $Date: 2004/02/29 14:17:42 $
Author:
Dmitri Plotnikov

Field Summary
private  java.util.List allFunctions
           
private  java.util.HashMap byNamespace
           
 
Constructor Summary
FunctionLibrary()
           
 
Method Summary
 void addFunctions(Functions functions)
          Add functions to the library
 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.
 java.util.Set getUsedNamespaces()
          Returns a set containing all namespaces used by the aggregated Functions.
private  void prepareCache()
           
 void removeFunctions(Functions functions)
          Remove functions from the library.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

allFunctions

private java.util.List allFunctions

byNamespace

private java.util.HashMap byNamespace
Constructor Detail

FunctionLibrary

public FunctionLibrary()
Method Detail

addFunctions

public void addFunctions(Functions functions)
Add functions to the library


removeFunctions

public void removeFunctions(Functions functions)
Remove functions from the library.


getUsedNamespaces

public java.util.Set getUsedNamespaces()
Returns a set containing all namespaces used by the aggregated Functions.

Specified by:
getUsedNamespaces in interface Functions

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 interface Functions

prepareCache

private void prepareCache()