public class JsonUtils extends Object
| Constructor and Description |
|---|
JsonUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Node |
convertToJson(Object source,
String label)
Converts object to JSON.
|
static Node |
convertToJson(Object source,
String label,
boolean lenient)
Converts object to JSON.
|
static Node |
getNode(Object root,
Path path)
Returns node with given path.
|
static Node |
getNode(Object root,
String path)
Returns node with given path.
|
static String |
getPathPrefix(Object json) |
static Object |
jsonSource(Object json,
String pathPrefix) |
static Object |
missingNode() |
static boolean |
nodeAbsent(Object json,
Path path,
Configuration configuration) |
static boolean |
nodeAbsent(Object json,
String path,
Configuration configuration) |
static boolean |
nodeExists(Object json,
String path)
Deprecated.
|
static Node |
valueToNode(Object source)
Converts value to Json node.
|
static Node |
wrapDeserializedObject(Object source)
Wraps deserialized object - supports null, String, numbers, maps, lists, ...
|
public static Node convertToJson(Object source, String label)
source - label - label to be logged in case of error.public static Node convertToJson(Object source, String label, boolean lenient)
source - label - label to be logged in case of error.lenient - lenient parser used for expected values. Allows unquoted keys.public static Node valueToNode(Object source)
source - public static Node getNode(Object root, String path)
root - path - public static Node getNode(Object root, Path path)
root - path - @Deprecated public static boolean nodeExists(Object json, String path)
public static boolean nodeAbsent(Object json, String path, Configuration configuration)
public static boolean nodeAbsent(Object json, Path path, Configuration configuration)
public static Node wrapDeserializedObject(Object source)
public static Object missingNode()
Copyright © 2019. All rights reserved.