Class JsonSupport
- java.lang.Object
-
- org.apache.sling.maven.bundlesupport.JsonSupport
-
public final class JsonSupport extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
JSON_MIME_TYPE
Mime type for json response.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
accumulate(Map<String,Object> obj, String name, String value)
static javax.json.JsonArray
parseArray(String jsonString)
Parse String to JSON array.static javax.json.JsonObject
parseObject(String jsonString)
Parse String to JSON object.static javax.json.JsonObject
toJson(Map<String,Object> map)
static void
validateJsonStructure(String jsonString, boolean tickToDoubleQuote)
Validate JSON structure
-
-
-
Field Detail
-
JSON_MIME_TYPE
public static final String JSON_MIME_TYPE
Mime type for json response.- See Also:
- Constant Field Values
-
-
Method Detail
-
parseObject
public static javax.json.JsonObject parseObject(String jsonString)
Parse String to JSON object.- Parameters:
jsonString
- JSON string- Returns:
- JSON object
-
parseArray
public static javax.json.JsonArray parseArray(String jsonString)
Parse String to JSON array.- Parameters:
jsonString
- JSON string- Returns:
- JSON array
-
validateJsonStructure
public static void validateJsonStructure(String jsonString, boolean tickToDoubleQuote)
Validate JSON structure- Parameters:
jsonString
- JSON stringtickToDoubleQuote
- Tick to double quote- Throws:
javax.json.JsonException
- when JSON structure is invalid
-
-