Class Functions
java.lang.Object
com.dashjoin.jsonata.Functions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic NumberAbsolute value of a numberstatic ObjectAppend second argument to firststatic voidstatic NumberAverage functionstatic Stringbase64decode(String str) Base64 decode a stringstatic Stringbase64encode(String str) Base64 encode a stringstatic Objectstatic Objectstatic NumberRounds a number up to integerstatic BooleanTests if the str contains the tokenstatic NumberCount functionstatic StringdateTimeFromMillis(Number millis, String picture, String timezone) Converts milliseconds since the epoch to an ISO 8601 timestampstatic LongdateTimeToMillis(String timestamp, String picture) Converts an ISO 8601 timestamp to milliseconds since the epochstatic StringDecode a string from a urlstatic StringdecodeUrlComponent(String str) Decode a string from a component for a urlstatic ObjectReturns the values that appear in a sequence, with duplicates eliminated.static Liststatic StringEncode a string into a urlstatic StringencodeUrlComponent(String str) Encode a string into a component for a urlstatic voidstatic List<com.dashjoin.jsonata.Functions.RegexpMatch> evaluateMatcher(Pattern matcher, String str) Evaluate the matcher function against the str argstatic booleanDetermines if the argument is undefinedstatic ListCreate a map from an array of argumentsstatic NumberRounds a number down to integerstatic ObjectFold left functionstatic StringformatBase(Number value, Number _radix) Converts a number to a string using a specified number basestatic StringformatInteger(Number value, String picture) Formats an integer as specified by the XPath fn:format-integer function See https://www.w3.org/TR/xpath-functions-31/#func-format-integerstatic StringformatNumber(Number value, String picture, Map options) Formats a number into a decimal string representation using XPath 3.1 Finvalid input: '&O' fn:format-number specstatic ObjectCall helper for Javastatic ObjectfunctionClone(Object arg) Clones an objectstatic ObjectfunctionEval(String expr, Object focus) parses and evaluates the supplied expressionstatic MethodgetFunction(Class clz, String name) static intgetFunctionArity(Object func) static ListhofFuncArgs(Object func, Object arg1, Object arg2, Object arg3) Helper function to build the arguments to be supplied to the function arg of the HOFs map, filter, each, sift and singlestatic booleanstatic booleanstatic StringJoin an array of stringsstatic ListReturn keys for an objectstatic Stringstatic Integerlength of a stringstatic ObjectReturn value from an object for a given keystatic StringLowercase a stringstatic ListCreate a map from an array of argumentsMatch a string with a regex returning an array of object containing details of each matchstatic NumberMax functionstatic ObjectMerges an array of objects into a single object.static longmillis()static NumberMin functionstatic Booleanreturns the Boolean NOT of the argstatic Stringstatic NumberCast argument to numberstatic StringPad a string to a minimum width by adding characters to the start or endstatic NumberparseInteger(String value, String picture) parse a string containing an integer as specified by the picture stringstatic NumberRaises number to the power of the second numberstatic Numberrandom()Returns a random number 0 invalid input: '<'= n invalid input: '<' 1static Stringstatic ListReverses the order of items in an arraystatic Stringstatic NumberRound to half evenstatic ListRandomly shuffles the contents of an arraystatic ObjectApplies a predicate function to each key/value pair in an object, and returns an object containing only the key/value pairs that passed the predicatestatic ObjectGiven an array, find the single element matching a specified condition Throws an exception if the number of matching elements is not exactly onestatic ListImplements the merge sort (stable) with optional comparator functionstatic ObjectSplits an object into an array of object with one property eachstatic NumberSquare root of numberstatic StringStringify argumentsstatic StringSource = Jsonata4Java JSONataUtils.substrstatic StringCreate substring based on character number and lengthstatic StringsubstringAfter(String str, String chars) Create substring after a characterstatic StringsubstringBefore(String str, String chars) Create substring up until a characterstatic NumberSum functionstatic Stringstatic BooleanEvaluate an input and return a booleanstatic StringNormalize and trim whitespace within a stringstatic Stringstatic StringUppercase a stringstatic voidvalidateInput(Object arg) Validate input data types.static Listzip(Utils.JList<List> args) Convolves (zips) each value from a set of arrays
-
Constructor Details
-
Functions
public Functions()
-
-
Method Details
-
sum
-
count
-
max
-
min
-
average
-
string
-
validateInput
Validate input data types. This will make sure that all input data can be processed.- Parameters:
arg-
-
substring
-
substr
Source = Jsonata4Java JSONataUtils.substr- Parameters:
str-start- Location at which to begin extracting characters. If a negative number is given, it is treated as strLength - start where strLength is the length of the string. For example, str.substr(-3) is treated as str.substr(str.length - 3)length- The number of characters to extract. If this argument is null, all the characters from start to the end of the string are extracted.- Returns:
- A new string containing the extracted section of the given string. If length is 0 or a negative number, an empty string is returned.
-
substringBefore
-
substringAfter
-
lowercase
-
uppercase
-
length
-
trim
-
pad
-
leftPad
-
rightPad
-
evaluateMatcher
-
contains
-
match
-
join
-
replace
-
base64encode
-
base64decode
-
encodeUrlComponent
-
encodeUrl
-
decodeUrlComponent
-
decodeUrl
-
split
-
formatNumber
-
formatBase
-
number
Cast argument to number- Throws:
NumberFormatExceptionJException
-
abs
-
floor
-
ceil
-
round
-
sqrt
-
power
-
random
Returns a random number 0 invalid input: '<'= n invalid input: '<' 1 -
toBoolean
-
not
-
getFunctionArity
-
hofFuncArgs
-
funcApply
-
map
-
filter
-
single
-
zip
Convolves (zips) each value from a set of arrays -
foldLeft
-
keys
-
exists
Determines if the argument is undefined -
spread
-
merge
-
reverse
-
each
-
error
-
assertFn
-
type
-
sort
-
shuffle
-
distinct
-
sift
-
append
-
isLambda
-
lookup
-
test
-
getFunction
-
call
-
call
-
dateTimeToMillis
Converts an ISO 8601 timestamp to milliseconds since the epoch- Throws:
ParseException
-
isNumeric
-
dateTimeFromMillis
-
formatInteger
-
parseInteger
parse a string containing an integer as specified by the picture string- Throws:
ParseExceptionJException
-
functionClone
-
functionEval
-
now
-
millis
public static long millis()
-