Class MatchFunction
- java.lang.Object
-
- com.api.jsonata4java.expressions.functions.FunctionBase
-
- com.api.jsonata4java.expressions.functions.MatchFunction
-
- All Implemented Interfaces:
Function,Serializable
public class MatchFunction extends FunctionBase implements Function
From 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. 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 pattern parameter must be a regular expression (regex) String used for searching the string. The optional limit parameter, is a number that specifies the maximum number of results to be found before stopping. Examples $match("John Smith and John Jones", "John") == "[{"match":"John","index":0,"groups":["John"]},{"match":"John","index":15,"groups":["John"]}]- 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 MatchFunction()
-
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
-
-