public class JSONUtil extends Object
Modifier and Type | Field and Description |
---|---|
static com.fasterxml.jackson.databind.ObjectMapper |
MAPPER |
Constructor and Description |
---|
JSONUtil() |
Modifier and Type | Method and Description |
---|---|
static com.fasterxml.jackson.databind.JsonNode |
asJson(Object value)
Convert object to JsonNode
|
static List<String> |
asListOfString(com.fasterxml.jackson.databind.JsonNode arrayNode) |
static String |
getClaimFromJWT(com.fasterxml.jackson.databind.JsonNode node,
String... path)
Get specific claim from token.
|
static String |
getClaimFromJWT(String claim,
Object token)
Get specific claim from token.
|
static com.fasterxml.jackson.databind.node.ObjectNode |
newObjectNode() |
static <T> T |
readJSON(InputStream is,
Class<T> clazz) |
public static com.fasterxml.jackson.databind.node.ObjectNode newObjectNode()
public static <T> T readJSON(InputStream is, Class<T> clazz) throws IOException
IOException
public static com.fasterxml.jackson.databind.JsonNode asJson(Object value)
value
- Json-serializable objectpublic static String getClaimFromJWT(String claim, Object token)
claim
- jq style query where nested names are specified using '.' as separatortoken
- parsed objectpublic static String getClaimFromJWT(com.fasterxml.jackson.databind.JsonNode node, String... path)
node
- parsed JWT token payloadpath
- name segments where all but last should each point to the next nested objectCopyright © 2022. All rights reserved.