Class TrimFunction
java.lang.Object
com.api.jsonata4java.expressions.functions.FunctionBase
com.api.jsonata4java.expressions.functions.TrimFunction
From 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.
If str is not specified (i.e. this function is invoked with no arguments),
then the context value is used as the value of str. An error is thrown if str
is not a string.
Examples
$trim(" Hello \n World ")=="Hello World"
-
Nested Class Summary
Nested classes/interfaces inherited from class com.api.jsonata4java.expressions.functions.FunctionBase
FunctionBase.CtxEvalResult -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintcom.fasterxml.jackson.databind.JsonNodeinvoke(ExpressionsVisitor expressionVisitor, MappingExpressionParser.Function_callContext ctx) Methods inherited from class com.api.jsonata4java.expressions.functions.FunctionBase
evalContext, getArgumentCount, getFunctionName
-
Field Details
-
ERR_BAD_CONTEXT
-
ERR_ARG1BADTYPE
-
ERR_ARG2BADTYPE
-
-
Constructor Details
-
TrimFunction
public TrimFunction()
-
-
Method Details
-
invoke
public com.fasterxml.jackson.databind.JsonNode invoke(ExpressionsVisitor expressionVisitor, MappingExpressionParser.Function_callContext ctx) - Specified by:
invokein classFunctionBase
-
getMaxArgs
public int getMaxArgs()- Specified by:
getMaxArgsin classFunctionBase
-
getMinArgs
public int getMinArgs()- Specified by:
getMinArgsin classFunctionBase
-
getSignature
- Specified by:
getSignaturein classFunctionBase
-