public abstract class NodeFunction<R> extends AbstractFunction<R>
MMObjectNodeFunction.Node.getFunctionValue(java.lang.String, java.util.List<?>),
BeanFunction,
Serialized FormautoReturnType, name, returnType| Constructor and Description |
|---|
NodeFunction(String name,
Parameter... def) |
NodeFunction(String name,
Parameter<?>[] def,
ReturnType<R> returnType) |
| Modifier and Type | Method and Description |
|---|---|
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 <S> NodeFunction<S> |
wrap(Function<S> function)
Tries to convert a certain Function object into a NodeFunction object.
|
compareTo, createParameters, equals, getDescription, getFunctionValueWithList, getName, getParameterDefinition, hashCode, setDescription, setParameterDefinition, setReturnType, toStringpublic NodeFunction(String name, Parameter<?>[] def, ReturnType<R> returnType)
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)
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 overriden 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 functionMMBase 1.9-SNAPSHOT - ${javadoctimestamp}