public final class JsonHelper extends Object
Modifier and Type | Method and Description |
---|---|
static Object |
getElement(com.fasterxml.jackson.databind.JsonNode json,
String name)
Return the field with name in JSON as a string, a boolean, a number or a node.
|
static com.fasterxml.jackson.databind.JsonNode |
getFirstNode(String text)
Return the first node of a JSON response.
|
static com.fasterxml.jackson.databind.JsonNode |
getFirstNode(String text,
String path)
Return the first node of a JSON response.
|
static com.fasterxml.jackson.databind.ObjectMapper |
getMapper() |
static String |
toJSONString(Object obj)
Returns the JSON string for the object.
|
public static com.fasterxml.jackson.databind.JsonNode getFirstNode(String text)
text
- JSON textpublic static com.fasterxml.jackson.databind.JsonNode getFirstNode(String text, String path)
text
- JSON textpath
- path to find the first nodepublic static Object getElement(com.fasterxml.jackson.databind.JsonNode json, String name)
json
- jsonname
- node namepublic static String toJSONString(Object obj)
obj
- the objectpublic static com.fasterxml.jackson.databind.ObjectMapper getMapper()
Copyright © 2017. All rights reserved.