Class EachFunction
- java.lang.Object
-
- com.api.jsonata4java.expressions.functions.FunctionBase
-
- com.api.jsonata4java.expressions.functions.EachFunction
-
- All Implemented Interfaces:
Function,Serializable
public class EachFunction extends FunctionBase implements Function
From https://docs.jsonata.org/object-functions#each $each(object,function($value, $key) 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. Examples $each(Address, function($v, $k) {$k & ": " & $v}) results in [ "Street: Hursley Park", "City: Winchester", "Postcode: SO21 2JN" ]- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringERR_ARG1_MUST_BE_ARRAY_OF_OBJECTSstatic StringERR_ARG1BADTYPEstatic StringERR_ARG2BADTYPEstatic StringERR_ARG3BADTYPEstatic StringERR_BAD_CONTEXT
-
Constructor Summary
Constructors Constructor Description EachFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddObject(ExpressionsVisitor.SelectorArrayNode result, com.fasterxml.jackson.databind.node.ObjectNode obj)intgetMaxArgs()intgetMinArgs()StringgetSignature()com.fasterxml.jackson.databind.JsonNodeinvoke(ExpressionsVisitor expressionVisitor, MappingExpressionParser.Function_callContext ctx)-
Methods inherited from class com.api.jsonata4java.expressions.functions.FunctionBase
getArgumentCount, getFunctionName
-
-
-
-
Field Detail
-
ERR_BAD_CONTEXT
public static String ERR_BAD_CONTEXT
-
ERR_ARG1BADTYPE
public static String ERR_ARG1BADTYPE
-
ERR_ARG2BADTYPE
public static String ERR_ARG2BADTYPE
-
ERR_ARG3BADTYPE
public static String ERR_ARG3BADTYPE
-
ERR_ARG1_MUST_BE_ARRAY_OF_OBJECTS
public static String ERR_ARG1_MUST_BE_ARRAY_OF_OBJECTS
-
-
Method Detail
-
invoke
public com.fasterxml.jackson.databind.JsonNode invoke(ExpressionsVisitor expressionVisitor, MappingExpressionParser.Function_callContext ctx)
-
getMaxArgs
public int getMaxArgs()
- Specified by:
getMaxArgsin interfaceFunction
-
getMinArgs
public int getMinArgs()
- Specified by:
getMinArgsin interfaceFunction
-
getSignature
public String getSignature()
- Specified by:
getSignaturein interfaceFunction
-
addObject
public void addObject(ExpressionsVisitor.SelectorArrayNode result, com.fasterxml.jackson.databind.node.ObjectNode obj)
-
-