Uses of Class
com.api.jsonata4java.expressions.functions.FunctionBase
Packages that use FunctionBase
Package
Description
-
Uses of FunctionBase in com.api.jsonata4java.expressions
Methods in com.api.jsonata4java.expressions that return FunctionBaseModifier and TypeMethodDescriptionExpressionsVisitor.getJsonataFunction(String fctName) FrameEnvironment.getJsonataFunction(String fctName) Methods in com.api.jsonata4java.expressions with parameters of type FunctionBaseModifier and TypeMethodDescriptionvoidExpressionsVisitor.setJsonataFunction(String fctName, FunctionBase fctValue) voidFrameEnvironment.setJsonataFunction(String fctName, FunctionBase fctValue) -
Uses of FunctionBase in com.api.jsonata4java.expressions.functions
Subclasses of FunctionBase in com.api.jsonata4java.expressions.functionsModifier and TypeClassDescriptionclassReturns the absolute value of the number parameter, i.e. if the number is negative, it returns the positive value.
http://docs.jsonata.org/numeric-functions.html
$abs(number)
If number is not specified (i.e. this function is invoked with no arguments), then the context value is used as the value of number.
Examples:
$abs(5)==5
$abs(-5)==5classclassAlways returns as a DoubleNode (regardless of input)classFrom http://docs.jsonata.org/string-functions.html: $base64decode() Converts base 64 encoded bytes to a string, using a UTF-8 Unicode codepage.classFrom http://docs.jsonata.org/string-functions.html: $base64encode(str) Converts an ASCII string to a base 64 representation.classFrom http://docs.jsonata.org/boolean-functions.htmlclasshttp://docs.jsonata.org/numeric-functions.html $ceil(number) Returns the value of number rounded up to the nearest integer that is greater than or equal to number.classFrom http://docs.jsonata.org/string-functions.html: $contains(str, pattern) Returns true if str is matched by pattern, otherwise it returns false.classclassFrom https://docs.jsonata.org/array-functions#distinct $distinct(array) Returns an array containing all the values from the array parameter, but with any duplicates removed.classReturns 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.classFrom http://docs.jsonata.org/string-functions.html: $error(str) Throws an error with the string as its message.classFrom http://docs.jsonata.org/string-functions.html: Signature: $eval(expr [, context]) Parses and evaluates the string expr which contains literal JSON or a JSONata expression using the current context as the context for evaluation.classclassFrom http://docs.jsonata.org/higher-order-functions#filter Signature: $filter(array, function) Returns an array containing only the values in the array parameter that satisfy the function predicate (i.e. function returns Boolean true when passed the value).classhttp://docs.jsonata.org/numeric-functions.html $floor(number) Returns the value of number rounded down to the nearest integer that is smaller or equal to number.classFrom http://docs.jsonata.org/string-functions.html: $formatBase(number [, radix]) Casts the number to a string and formats it to an integer represented in the number base specified by the radix argument.classFrom http://docs.jsonata.org/string-functions.html: $formatNumber(number, picture [, options]) Casts the number to a string and formats it to a decimal representation as specified by the picture string.classFrom http://docs.jsonata.org/string-functions.html: $fromMillis(number) Convert a number representing milliseconds since the Unix Epoch (1 January, 1970 UTC) to a timestamp string in the ISO 8601 format.classFrom http://docs.jsonata.org/string-functions.html: $fromMillis(number) Convert a number representing milliseconds since the Unix Epoch (1 January, 1970 UTC) to a timestamp string in the ISO 8601 format.classclassFrom http://docs.jsonata.org/string-functions.html: $join(array[, separator]) Joins an array of component strings into a single concatenated string with each component string separated by the optional separator parameter.classFrom http://docs.jsonata.org/object-functions.html $keys(object) Returns the keys in an array of Strings.classFrom http://docs.jsonata.org/string-functions.html: $length(str) Returns the number of characters in the string str.classFrom http://docs.jsonata.org/object-functions.html $lookup(object,key) Returns the value corresponding to the key in the supplied object.classFrom http://docs.jsonata.org/string-functions.html: $lowercase(str) Returns a string with all the characters of str converted to lowercase.classFrom http://docs.jsonata.org/higher-order-functions#map Signature: $map(array, function) Returns an array containing the results of applying the function parameter to each value in the array parameter.classFrom http://docs.jsonata.org/string-functions.html: $match(str, pattern [, limit]) Finds occurrences of pattern within str and reports them with their index and group.classFrom http://docs.jsonata.org/aggregation-functions.html $max(array) Returns the maximum number in an array of numbers.classReturns the merger of the objects in an array of objects.classhttp://docs.jsonata.org/numeric-functions.html $millis() Returns the number of milliseconds since the Unix Epoch (1 January, 1970 UTC) as a number.classFrom http://docs.jsonata.org/aggregation-functions.html $min(array) Returns the minimum number in an array of numbers.classclassFrom http://docs.jsonata.org/string-functions.html: $now() Generates a UTC timestamp in ISO 8601 compatible format and returns it as a string.classhttp://docs.jsonata.org/numeric-functions.html Casts the arg parameter to a number using the following casting rules: - Numbers are unchanged - Strings that contain a sequence of characters that represent a legal JSON number are converted to that number - All other values cause an error to be thrown.classFrom http://docs.jsonata.org/string-functions.html: $pad(str, width [, char]) Returns a copy of the string str with extra padding, if necessary, so that its total number of characters is at least the absolute value of the width parameter.classhttp://docs.jsonata.org/numeric-functions.html $power(base, exponent) Returns the value of base raised to the power of exponent (baseexponent).classhttp://docs.jsonata.org/numeric-functions.html $random() Returns a pseudo random number greater than or equal to zero and less than one (0 ≤ n < 1) Examples $random()==0.7973541067127 $random()==0.4029142127028 $random() == 0.6558078550072classFrom http://docs.jsonata.org/higher-order-functions#reduce Signature: $reduce(array, function [, init]) Returns an aggregated value derived from applying the function parameter successively to each value in array in combination with the result of the previous application of the function.classFrom http://docs.jsonata.org/string-functions.html: $replace(str, pattern, replacement [, limit]) Finds occurrences of pattern within str and replaces them with replacement.classclasshttp://docs.jsonata.org/numeric-functions.html $round(number [, precision]) Returns the value of the number parameter rounded to the number of decimal places specified by the optional precision parameter.classclassFrom http://docs.jsonata.org/object-functions.html $spread(object) Splits an object containing key/value pairs into an array of objects, each of which has a single key/value pair from the input object.classclassFrom http://docs.jsonata.org/string-functions.html: $split(str, separator [, limit]) Splits the str parameter into an array of substrings.classFrom http://docs.jsonata.org/object-functions.html $spread(object) Splits an object containing key/value pairs into an array of objects, each of which has a single key/value pair from the input object.classhttp://docs.jsonata.org/numeric-functions.html $sqrt(number) Returns the square root of the value of the number parameter.classFrom http://docs.jsonata.org/string-functions.html: $string(arg) Casts the arg parameter to a string using the following casting rules Strings are unchanged Functions are converted to an empty string Numeric infinity and NaN throw an error because they cannot be represented as a JSON number All other values are converted to a JSON string using the JSON.stringify function If arg is not specified (i.e. this function is invoked with no arguments), then the context value is used as the value of arg.classFrom http://docs.jsonata.org/string-functions.html: $substringAfter(str, chars) Returns the substring after the first occurrence of the character sequence chars in str.classFrom http://docs.jsonata.org/string-functions.html: $substringBefore(str, chars) Returns the substring before the first occurrence of the character sequence chars in str.classComplies with javascript substr (and thus JSONata $substring).classclasshttp://docs.jsonata.org/numeric-functions.html $toMillis(timestamp) Convert a timestamp string in the ISO 8601 format to the number of milliseconds since the Unix Epoch (1 January, 1970 UTC) as a number.classFrom http://docs.jsonata.org/string-functions.html: $trim(str) Normalizes and trims all whitespace characters in str by applying the following steps: * All tabs, carriage returns, and line feeds are replaced with spaces. * Contiguous sequences of spaces are reduced to a single space. * Trailing and leading spaces are removed.classFrom http://docs.jsonata.org/string-functions.html: $trim(str) Normalizes and trims all whitespace characters in str by applying the following steps: * All tabs, carriage returns, and line feeds are replaced with spaces. * Contiguous sequences of spaces are reduced to a single space. * Trailing and leading spaces are removed.classclassFrom http://docs.jsonata.org/string-functions.html: $uppercase(str) Returns a string with all the characters of str converted to uppercase.classFrom http://docs.jsonata.org/string-functions.html: $length(str) Returns the number of characters in the string str.classFrom http://docs.jsonata.org/string-functions.html: $length(str) Returns the number of characters in the string str.classFrom http://docs.jsonata.org/string-functions.html: $length(str) Returns the number of characters in the string str.classFrom http://docs.jsonata.org/string-functions.html: $length(str) Returns the number of characters in the string str.class -
Uses of FunctionBase in com.api.jsonata4java.expressions.utils
Fields in com.api.jsonata4java.expressions.utils with type parameters of type FunctionBaseMethods in com.api.jsonata4java.expressions.utils with parameters of type FunctionBaseModifier and TypeMethodDescriptionstatic com.fasterxml.jackson.databind.JsonNodeFunctionUtils.processFctCallVariables(ExpressionsVisitor exprVisitor, FunctionBase function, org.antlr.v4.runtime.tree.TerminalNode varid, MappingExpressionParser.Function_callContext ctx, com.fasterxml.jackson.databind.JsonNode value, String key, com.fasterxml.jackson.databind.node.ObjectNode object) Creates anMappingExpressionParser.ExprListContextcontaining the parenthesized comma separated variable list of JsonNode elements, sets it in the supplied context (ctx) and then executes the function to return its result.static com.fasterxml.jackson.databind.JsonNodeFunctionUtils.processVariablesCallFunction(ExpressionsVisitor exprVisitor, FunctionBase function, org.antlr.v4.runtime.tree.TerminalNode varid, MappingExpressionParser.Function_callContext ctx, com.fasterxml.jackson.databind.JsonNode... elements) Creates anMappingExpressionParser.ExprListContextcontaining the parenthesized comma separated variable list of JsonNode elements, sets it in the supplied context (ctx) and then executes the function to return its result.static booleanFunctionUtils.useContextVariable(FunctionBase fct, MappingExpressionParser.Function_callContext ctx, String signature) Determine if the function should use the context variable as its first parameter