|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.util.functions.AbstractFunction
org.mmbase.util.functions.NodeFunction
A NodeFunction represents a function on a node instances of this builder. This means that it always has one implicit node argument. This node-argument needs not be mentioned in the Parameter array of the constructor.
MMObjectBuilder.executeFunction(org.mmbase.module.core.MMObjectNode, java.lang.String, java.util.List),
Node.getFunctionValue(java.lang.String, java.util.List),
BeanFunction,
Serialized Form| Field Summary |
| Fields inherited from class org.mmbase.util.functions.AbstractFunction |
name, returnType |
| Constructor Summary | |
NodeFunction(String name,
Parameter[] def,
ReturnType returnType)
|
|
| Method Summary | |
protected MMObjectNode |
getCoreNode(MMObjectBuilder builder,
Node node)
Utility method to convert a Node to a a MMObjectNode. |
static String |
getFunctionNameAndFillArgs(String function,
List args)
|
protected Object |
getFunctionValue(MMObjectNode coreNode,
Parameters parameters)
Implements the function on a certain node. |
protected abstract Object |
getFunctionValue(Node node,
Parameters parameters)
|
static FieldValue |
getFunctionValue(Node node,
String function)
Utility function, for easy call of function on node by one string. |
Object |
getFunctionValue(Parameters parameters)
To implement a NodeFunction, you must override getFunctionValue(Node, Parameters). |
protected Node |
getNode(Parameters parameters)
|
protected static Parameter[] |
getNodeParameterDef(Parameter[] def)
|
Function |
newInstance(MMObjectNode node)
Returns a new instance of NodeInstanceFunction, which represents an actual Function. |
| Methods inherited from class org.mmbase.util.functions.AbstractFunction |
compareTo, createParameters, equals, getDescription, getFunctionValueWithList, getName, getParameterDefinition, getReturnType, hashCode, setDescription, setParameterDefinition, setReturnType, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public NodeFunction(String name,
Parameter[] def,
ReturnType returnType)
| Method Detail |
public static FieldValue getFunctionValue(Node node,
String function)
public static String getFunctionNameAndFillArgs(String function,
List args)
protected static Parameter[] getNodeParameterDef(Parameter[] def)
public final Function newInstance(MMObjectNode node)
protected final Object getFunctionValue(MMObjectNode coreNode,
Parameters parameters)
getFunctionValue(org.mmbase.bridge.Node, Parameters). Overriding the
bridge version has two advantages. It's easier, and mmbase security will be honoured. That
last thing is of course not necesary if you are not going to use other nodes.
XXX: made final because it does not work well if you don't implement a bridge version
protected final MMObjectNode getCoreNode(MMObjectBuilder builder,
Node node)
Node to a a MMObjectNode.
protected abstract Object getFunctionValue(Node node,
Parameters parameters)
protected Node getNode(Parameters parameters)
public Object getFunctionValue(Parameters parameters)
getFunctionValue(Node, Parameters).
This one can be overriden if the same function must also be a builder function.
getFunctionValue in interface FunctiongetFunctionValue in class AbstractFunctionparameters - The parameters for the function. To specify an empty parameter list use Parameters.VOID.
Implementors are encouraged to support null too.
AbstractFunction.getReturnType()AbstractFunction.createParameters()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||