org.mmbase.util.functions
Class FunctionSets

java.lang.Object
  extended by org.mmbase.util.functions.FunctionSets

public class FunctionSets
extends Object

A utility class for maintaining and querying functionsets. A set function belongs to a certain namespace of functions ('sets'), and therefore is identified by two strings: The name of the 'set' and the name of the function.
Function sets can be defined in the functions/functionsets.xml configuration file.
This class implements a number of static methods for maintaining FunctionSet objects, and filling these with FunctionSet objects that match the namespace. It also implements a getFunction(java.lang.String, java.lang.String) method for obtaining a function from such a set.

Since:
MMBase-1.8
Version:
$Id: FunctionSets.java 42625 2010-06-21 09:47:28Z michiel $
Author:
Daniël Ockeloen, Michiel Meeuwissen

Field Summary
static String DTD_FUNCTIONSET_1_0
           
static String DTD_FUNCTIONSETS_1_0
           
static String FUNCTIONSET_NS
           
static String PUBLIC_ID_FUNCTIONSET_1_0
           
static String PUBLIC_ID_FUNCTIONSETS_1_0
           
 
Constructor Summary
FunctionSets()
           
 
Method Summary
static Function<?> getFunction(String setName, String functionName)
          Returns the Function with the given function name, and which exists in the set with the given set name.
static FunctionSet getFunctionSet(String setName)
          Returns the FunctionSet with the given set name.
static Map<String,FunctionSet> getFunctionSets()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DTD_FUNCTIONSET_1_0

public static final String DTD_FUNCTIONSET_1_0
See Also:
Constant Field Values

DTD_FUNCTIONSETS_1_0

public static final String DTD_FUNCTIONSETS_1_0
See Also:
Constant Field Values

PUBLIC_ID_FUNCTIONSET_1_0

public static final String PUBLIC_ID_FUNCTIONSET_1_0
See Also:
Constant Field Values

PUBLIC_ID_FUNCTIONSETS_1_0

public static final String PUBLIC_ID_FUNCTIONSETS_1_0
See Also:
Constant Field Values

FUNCTIONSET_NS

public static final String FUNCTIONSET_NS
See Also:
Constant Field Values
Constructor Detail

FunctionSets

public FunctionSets()
Method Detail

getFunction

public static Function<?> getFunction(String setName,
                                      String functionName)
Returns the Function with the given function name, and which exists in the set with the given set name. If this is the first call, or if the set does not exist in the cache, the cache is refreshed by reading the functionset.xml configuration file.

Parameters:
setName - the name of the function set
functionName - the name of the function
Returns:
the Function, or nulll if either the fucntion or set is not defined

getFunctionSet

public static FunctionSet getFunctionSet(String setName)
Returns the FunctionSet with the given set name. If this is the first call, or if the set does not exist in the cache, the cache is refreshed by reading the functionset.xml configuration file. configuration file.

Parameters:
setName - the name of the function set
Returns:
the FunctionSet, or null if the set is not defined

getFunctionSets

public static Map<String,FunctionSet> getFunctionSets()
Since:
MMBase-1.9


MMBase 2.0-SNAPSHOT - null