|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectorg.mmbase.util.functions.AbstractFunction<R>
org.mmbase.util.functions.NodeFunction<R>
public abstract class NodeFunction<R>
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.
If you need to impelment this and like to use MMObjectNodes for the implementation (which would probably make the function unusable in RMMCI), then you could
extend MMObjectNodeFunction.
Node.getFunctionValue(java.lang.String, java.util.List>),
BeanFunction,
Serialized Form| Field Summary |
|---|
| Fields inherited from class org.mmbase.util.functions.AbstractFunction |
|---|
autoReturnType, name, returnType |
| Constructor Summary | |
|---|---|
NodeFunction(String name,
Parameter... def)
|
|
NodeFunction(String name,
Parameter<?>[] def,
ReturnType<R> returnType)
|
|
| Method Summary | ||
|---|---|---|
static String |
getFunctionNameAndFillArgs(String function,
List<String> args)
|
|
protected abstract R |
getFunctionValue(Node node,
Parameters parameters)
|
|
static FieldValue |
getFunctionValue(Node node,
String function)
Utility function, for easy call of function on node by one string. |
|
R |
getFunctionValue(Parameters parameters)
To implement a NodeFunction, you must override getFunctionValue(Node, Parameters). |
|
R |
getFunctionValueForNode(Node node,
Parameters parameters)
Just a public wrapper around getFunctionValue(Node, Parameters) (of which we don't want to loosen the scope, because it may be overriden protected). |
|
protected Node |
getNode(Parameters parameters)
|
|
protected static Parameter[] |
getNodeParameterDef(Parameter... def)
|
|
ReturnType<R> |
getReturnType()
|
|
Function<R> |
newInstance(Node node)
Returns a new instance of NodeInstanceFunction, which represents an actual Function. |
|
static
|
wrap(Function<S> function)
Tries to convert a certain Function object into a NodeFunction object. |
|
| Methods inherited from class org.mmbase.util.functions.AbstractFunction |
|---|
compareTo, createParameters, equals, getDescription, getFunctionValueWithArgs, getFunctionValueWithList, getName, getParameterDefinition, 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<R> returnType)
public NodeFunction(String name,
Parameter... def)
| Method Detail |
|---|
public ReturnType<R> getReturnType()
getReturnType in interface Function<R>getReturnType in class AbstractFunction<R>null if not set already.
public static FieldValue getFunctionValue(Node node,
String function)
public static String getFunctionNameAndFillArgs(String function,
List<String> args)
protected static Parameter[] getNodeParameterDef(Parameter... def)
public final Function<R> newInstance(Node node)
protected abstract R getFunctionValue(Node node,
Parameters parameters)
public final R getFunctionValueForNode(Node node,
Parameters parameters)
getFunctionValue(Node, Parameters) (of which we don't want to loosen the scope, because it may be overriden protected).
protected Node getNode(Parameters parameters)
public R getFunctionValue(Parameters parameters)
getFunctionValue(Node, Parameters).
This one can be overridden if the same function must also be a builder function.
getFunctionValue in interface Function<R>getFunctionValue in class AbstractFunction<R>parameters - 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()public static <S> NodeFunction<S> wrap(Function<S> function)
function if that was already a NodeFunction, null if it
could not be wrapped (No Parameter.NODE parameter), or a new NodeFunction object
wrapping function
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||