| org.mmbase.util.functions.Function
Function | public interface Function (Code) | | A representation of a piece of functionality (a 'function'). A function has a name, a
return type, and a parameter-definition (which is a
Parameter array).
The goal of a Function object is to call its
Function.getFunctionValue(Parameters) method, which
executes it, given the specified parameters.
author: Pierre van Rooden author: Daniel Ockeloen author: Michiel Meeuwissen version: $Id: Function.java,v 1.10 2006/09/27 20:42:21 michiel Exp $ since: MMBase-1.7 See Also: Parameter See Also: Parameters |
getFunctionValue | public R getFunctionValue(Parameters parameters)(Code) | | Executes the defined function supplying the given arguments.
See Also: Function.createParameters Parameters: parameters - The parameters for the function. To specify an empty parameter list use Parameters.VOID.Implementors are encouraged to support null too. The function value, which can be of any type compatible to Function.getReturnType |
getFunctionValue | public R getFunctionValue(Object... parameters)(Code) | | since: MMBase-1.9 |
getFunctionValueWithList | public R getFunctionValueWithList(List> parameters)(Code) | | Executes the defined function supplying the given List of arguments.
This is a convenience method, as the List is mapped to a Parameters type and passed to
Function.getFunctionValue(Parameters) .
Parameters: parameters - The parameters for the function. To specify an empty parameter list use Parameters.VOID. The function value, which can be of any type compatible to Function.getReturnType |
getName | public String getName()(Code) | | A function must have a name. This is the name which was used to aquire the function object.
The function's name, never null |
getParameterDefinition | public Parameter>[] getParameterDefinition()(Code) | | The currently set Parameter definition array, or null if not set already. |
getReturnType | public ReturnType<R> getReturnType()(Code) | | The return type of the function's result value, or null if unknown. |
setDescription | public void setDescription(String description)(Code) | | For documentational purposes a function object needs a description too.
|
setParameterDefinition | public void setParameterDefinition(Parameter>[] params)(Code) | | A function object is of no use, as long as it lacks a definition.
Parameters: params - An array of Parameter objects. throws: IllegalStateException - if there was already set a parameter definition for this function object. |
setReturnType | public void setReturnType(ReturnType<R> type)(Code) | | Sets the return type of the function's result value.
Parameters: type - A ReturnType object. For void functions that could be ReturnType.VOID. throws: IllegalStateException - if there was already set a return type for this function object. |
|
|