org.mmbase.module.core
Class MMObjectNodeFunction<R>
java.lang.Object
org.mmbase.util.functions.AbstractFunction<R>
org.mmbase.util.functions.NodeFunction<R>
org.mmbase.module.core.MMObjectNodeFunction<R>
- All Implemented Interfaces:
- Serializable, Comparable<Function<R>>, Function<R>
- Direct Known Subclasses:
- GuiFunction
public abstract class MMObjectNodeFunction<R>
- extends NodeFunction<R>
Sometimes you may want to implement a function on a node based on an MMObjectNode instance.
This provides getCoreNode(org.mmbase.module.core.MMObjectBuilder, org.mmbase.bridge.Node), which can be used to produce an instance of that.
- Since:
- MMBase-1.9.2
- Version:
- $Id: NodeFunction.java 38475 2009-09-07 14:10:55Z michiel $
- Author:
- Michiel Meeuwissen
- See Also:
MMObjectBuilder.executeFunction(org.mmbase.module.core.MMObjectNode, java.lang.String, java.util.List>),
Node.getFunctionValue(java.lang.String, java.util.List>),
BeanFunction,
Serialized Form
| Methods inherited from class org.mmbase.util.functions.AbstractFunction |
compareTo, createParameters, equals, getDescription, getFunctionValueWithArgs, getFunctionValueWithList, getName, getParameterDefinition, hashCode, setDescription, setParameterDefinition, setReturnType, toString |
MMObjectNodeFunction
public MMObjectNodeFunction(String name,
Parameter<?>[] def,
ReturnType<R> returnType)
MMObjectNodeFunction
public MMObjectNodeFunction(String name,
Parameter... def)
- Since:
- MMBase-1.9
newInstance
public static <Q> Function<Q> newInstance(NodeFunction<Q> function,
MMObjectNode node)
newInstance
public final Function<R> newInstance(MMObjectNode node)
- Returns a new instance of NodeInstanceFunction, which represents an actual Function.
getNode
protected static Node getNode(MMObjectNode coreNode,
Parameters parameters)
getFunctionValue
protected final R getFunctionValue(MMObjectNode coreNode,
Parameters parameters)
- Implements the function on a certain node. Override this method or it's bridge
counter-part
NodeFunction.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
getCoreNode
protected final MMObjectNode getCoreNode(MMObjectBuilder builder,
Node node)
- Utility method to convert a
Node to a MMObjectNode.
MMBase 2.0-SNAPSHOT - null