Class SplitFunction
- java.lang.Object
-
- com.api.jsonata4java.expressions.functions.FunctionBase
-
- com.api.jsonata4java.expressions.functions.SplitFunction
-
- All Implemented Interfaces:
Function,Serializable
public class SplitFunction extends FunctionBase implements Function
From http://docs.jsonata.org/string-functions.html: $split(str, separator [, limit]) Splits the str parameter into an array of substrings. If str is not specified, then the context value is used as the value of str. It is an error if str is not a string. The separator parameter can either be a string or a regular expression (regex). If it is a string, it specifies the characters within str about which it should be split. If it is the empty string, str will be split into an array of single characters. If it is a regex, it splits the string around any sequence of characters that match the regex. The optional limit parameter is a number that specifies the maximum number of substrings to include in the resultant array. Any additional substrings are discarded. If limit is not specified, then str is fully split with no limit to the size of the resultant array. It is an error if limit is not a non-negative number. Examples $split("so many words", " ")==[ "so", "many", "words" ] $split("so many words", " ", 2)==[ "so", "many" ] $split("too much, punctuation. hard; to read", "[ ,.;]+")==["too", "much", "punctuation", "hard", "to", "read"]- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringERR_ARG1BADTYPEstatic StringERR_ARG2BADTYPEstatic StringERR_ARG3BADTYPEstatic StringERR_ARG4BADTYPEstatic StringERR_BAD_CONTEXT
-
Constructor Summary
Constructors Constructor Description SplitFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
-
-
-
-
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
-
-