Package org.apache.commons.jxpath

# Class FunctionLibrary

java.lang.Object
org.apache.commons.jxpath.FunctionLibrary

All Implemented Interfaces:
  `Functions`

public class FunctionLibrary extends 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.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FunctionLibrary()`
  Constructs a new instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addFunctions(Functions functions)`
  Add functions to the library
  `Function`
  `getFunction(String namespace, String name, Object[] parameters)`
  Gets a Function, if any, for the specified namespace, name and parameter types.
  `Set<String>`
  `getUsedNamespaces()`
  Gets a set containing all namespaces used by the aggregated Functions.
  `void`
  `removeFunctions(Functions functions)`
  Removes functions from the library.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### FunctionLibrary

    public FunctionLibrary()
    Constructs a new instance.

- ## Method Details

  - ### addFunctions

    public void addFunctions(Functions functions)
    Add functions to the library
    Parameters:
      `functions` - to add

  - ### getFunction

    public Function getFunction(String namespace, String name, Object[] parameters)
    Gets a Function, if any, for the specified namespace, name and parameter types.
    Specified by:
      `getFunction` in interface `Functions`
    Parameters:
      `namespace` - function namespace
      `name` - function name
      `parameters` - parameters
    Returns:
      Function found

  - ### getUsedNamespaces

    public Set<String> getUsedNamespaces()
    Gets a set containing all namespaces used by the aggregated Functions.
    Specified by:
      `getUsedNamespaces` in interface `Functions`
    Returns:
      a set containing all namespaces used by the aggregated Functions.

  - ### removeFunctions

    public void removeFunctions(Functions functions)
    Removes functions from the library.
    Parameters:
      `functions` - to remove.