public class JSONCreator
extends java.lang.Object
| Constructor and Description |
|---|
JSONCreator() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
createJson(java.lang.String creationRules,
java.lang.String jsonObj)
Create a new json by mapping json path expression with its value.
|
static java.lang.String |
createJsonWithDelimiter(java.lang.String creationRules,
java.lang.String jsonObj,
java.lang.String jsonOperator,
java.lang.String filterStartString,
java.lang.String filterStopString)
Create a new json by mapping json path expression with its value.
|
public static java.lang.String createJson(java.lang.String creationRules,
java.lang.String jsonObj)
throws java.lang.Exception
creationRules - Mapping JSON Path expressions and their respective values. Here we are creating the required JSON structure based on the JSON PATH expression.jsonObj - json object from which values can be referred to create new json.java.lang.Exception - Invalid path.public static java.lang.String createJsonWithDelimiter(java.lang.String creationRules,
java.lang.String jsonObj,
java.lang.String jsonOperator,
java.lang.String filterStartString,
java.lang.String filterStopString)
throws java.lang.Exception
creationRules - Mapping JSON Path expressions and their respective values. Here we are creating the required JSON structure based on the JSON PATH expression.jsonObj - json object from which values can be referred to create new json.jsonOperator - Delimiter used to operate on json object. By default '.' operator is used.filterStartString - Delimiter denoting starting point of the filter. By default '[' is used.filterStopString - Delimiter denoting end point of the filter. By default ']' is used.java.lang.Exception - Invalid path.