| java.lang.Object org.mmbase.util.functions.AbstractFunction
AbstractFunction | abstract public class AbstractFunction implements Function<R>,Comparable<Function<R>>,java.io.Serializable(Code) | | An abstract 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
AbstractFunction.getFunctionValue(Parameters) method, which
executes it, given the specified parameters.
author: Daniel Ockeloen author: Michiel Meeuwissen version: $Id: AbstractFunction.java,v 1.20 2007/06/21 15:50:21 nklasens Exp $ since: MMBase-1.8 See Also: Parameter See Also: Parameters |
autoReturnType | protected boolean autoReturnType(Code) | | |
getFunctionValue | final public R getFunctionValue(Object... parameters)(Code) | | since: MMBase-1.9 |
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 currently set ReturnType, or null if not set already. |
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 defintion for this function object. |
setReturnType | public void setReturnType(ReturnType<R> type)(Code) | | Sets the ReturnType for this function if not set already.
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. |
|
|