Class PadFunction
java.lang.Object
com.api.jsonata4java.expressions.functions.FunctionBase
com.api.jsonata4java.expressions.functions.PadFunction
From 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. If width is a positive number, then the string is padded to the
right; if negative, it is padded to the left. The optional char argument
specifies the padding character(s) to use. If not specified, it defaults to
the space character.
Examples
$pad("foo", 5)=="foo " $pad("foo", -5)==" foo" $pad("foo", -5, "#") ==
"##foo" $formatBase(35, 2) ~> $pad(-8, '0')=="00100011"
-
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) static Stringstatic StringMethods inherited from class com.api.jsonata4java.expressions.functions.FunctionBase
evalContext, getArgumentCount, getFunctionName
-
Field Details
-
ERR_BAD_CONTEXT
-
ERR_ARG1BADTYPE
-
ERR_ARG2BADTYPE
-
ERR_ARG3BADTYPE
-
ERR_ARG4BADTYPE
-
-
Constructor Details
-
PadFunction
public PadFunction()
-
-
Method Details
-
invoke
public com.fasterxml.jackson.databind.JsonNode invoke(ExpressionsVisitor expressionVisitor, MappingExpressionParser.Function_callContext ctx) - Specified by:
invokein classFunctionBase
-
leftPad
-
rightPad
-
getMaxArgs
public int getMaxArgs()- Specified by:
getMaxArgsin classFunctionBase
-
getMinArgs
public int getMinArgs()- Specified by:
getMinArgsin classFunctionBase
-
getSignature
- Specified by:
getSignaturein classFunctionBase
-