Class EachFunction
java.lang.Object
com.api.jsonata4java.expressions.functions.FunctionBase
com.api.jsonata4java.expressions.functions.EachFunction
Returns an array containing the values return by the function when applied to
each key/value pair in the object.
The function parameter will get invoked with two arguments:
function(value, name)
where the value parameter is the value of each name/value pair in the object and name is its name. The name parameter is optional.
From https://docs.jsonata.org/object-functions#each
$each(object,function($value, $key)
Examples
$each(Address, function($v, $k) {$k & ": " & $v})
results in [ "Street: Hursley Park", "City: Winchester", "Postcode: SO21 2JN" ]
The function parameter will get invoked with two arguments:
function(value, name)
where the value parameter is the value of each name/value pair in the object and name is its name. The name parameter is optional.
From https://docs.jsonata.org/object-functions#each
$each(object,function($value, $key)
Examples
$each(Address, function($v, $k) {$k & ": " & $v})
results in [ "Street: Hursley Park", "City: Winchester", "Postcode: SO21 2JN" ]
-
Nested Class Summary
Nested classes/interfaces inherited from class com.api.jsonata4java.expressions.functions.FunctionBase
FunctionBase.CtxEvalResult -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintcom.fasterxml.jackson.databind.JsonNodeinvoke(ExpressionsVisitor expressionVisitor, MappingExpressionParser.Function_callContext ctx) Methods inherited from class com.api.jsonata4java.expressions.functions.FunctionBase
evalContext, getArgumentCount, getFunctionName
-
Field Details
-
ERR_BAD_CONTEXT
-
ERR_ARG1BADTYPE
-
ERR_ARG2BADTYPE
-
ERR_ARG3BADTYPE
-
ERR_ARG1_MUST_BE_ARRAY_OF_OBJECTS
-
-
Constructor Details
-
EachFunction
public EachFunction()
-
-
Method Details
-
invoke
public com.fasterxml.jackson.databind.JsonNode invoke(ExpressionsVisitor expressionVisitor, MappingExpressionParser.Function_callContext ctx) - Specified by:
invokein classFunctionBase
-
getMaxArgs
public int getMaxArgs()- Specified by:
getMaxArgsin classFunctionBase
-
getMinArgs
public int getMinArgs()- Specified by:
getMinArgsin classFunctionBase
-
getSignature
- Specified by:
getSignaturein classFunctionBase
-