Class EscapeJsonFunction
java.lang.Object
org.citrusframework.functions.core.EscapeJsonFunction
- All Implemented Interfaces:
org.citrusframework.functions.Function,org.citrusframework.functions.ParameterizedFunction<StringParameter>,StringFunction
This function takes a JSON string as input and escapes all double quotes within it.
The input must be a single non-empty string containing a valid JSON, wrapped in double quotes.
If the input is invalid (null, empty, or contains more than one string), an IllegalArgumentException will be thrown.
Example input: "{\"mySuperJson\": \"valium\"}"
Example output: "{\\\"mySuperJson\\\": \\\"valium\\\"}"
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.citrusframework.functions.ParameterizedFunction
org.citrusframework.functions.ParameterizedFunction.FunctionParameters -
Field Summary
Fields inherited from interface org.citrusframework.functions.Function
functions, logger, RESOURCE_PATH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionExecute function with the single String parameter.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.citrusframework.functions.ParameterizedFunction
executeMethods inherited from interface org.citrusframework.functions.StringFunction
execute
-
Constructor Details
-
EscapeJsonFunction
public EscapeJsonFunction()
-
-
Method Details
-
execute
Description copied from interface:StringFunctionExecute function with the single String parameter.- Specified by:
executein interfaceStringFunction
-
getParameters
- Specified by:
getParametersin interfaceorg.citrusframework.functions.ParameterizedFunction<StringParameter>- Specified by:
getParametersin interfaceStringFunction
-