public class JsonUtil extends Object
Constructor and Description |
---|
JsonUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isValidJson(String value) |
net.sf.json.JSON |
parseTrimmedText(String text) |
static boolean |
seemsToBeJson(String content) |
static boolean |
seemsToBeJsonContentType(String contentType)
This method and its name are somewhat awkward, but both stem from the fact that there are so many commonly used
content types for JSON.
|
public static boolean isValidJson(String value)
public static boolean seemsToBeJsonContentType(String contentType)
contentType
- the MIME type to examinetrue
if content type is non-null and contains either "json" or "javascript"public static boolean seemsToBeJson(String content)
public net.sf.json.JSON parseTrimmedText(String text)
Copyright © 2019. All Rights Reserved.