java.lang.Object
net.javacrumbs.jsonunit.core.internal.JsonUtils
Internal utility class to parse JSON values.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic NodeconvertToJson(@Nullable Object source, String label) Converts object to JSON.static NodeconvertToJson(@Nullable Object source, String label, boolean lenient) Converts object to JSON.static @NotNull NodeReturns node with given path.static @NotNull NodeReturns node with given path.static @NotNull StringgetPathPrefix(Object json) static @NotNull ObjectjsonSource(Object json, String pathPrefix) static @NotNull ObjectjsonSource(Object json, String pathPrefix, List<String> matchingPaths) static Objectstatic booleannodeAbsent(Object json, String path, Configuration configuration) static booleannodeAbsent(Object json, Path path, Configuration configuration) static @NotNull NodevalueToNode(Object source) Converts value to Json node.static NodewrapDeserializedObject(Object source) Wraps deserialized object - supports null, String, numbers, maps, lists, ...
-
Constructor Details
-
JsonUtils
public JsonUtils()
-
-
Method Details
-
convertToJson
Converts object to JSON.- Parameters:
source-label- label to be logged in case of error.- Returns:
-
convertToJson
Converts object to JSON. -
valueToNode
Converts value to Json node. It can be Map, String, null, or primitive. Should not be parsed, just converted. -
getNode
Returns node with given path. -
getNode
Returns node with given path. -
nodeAbsent
-
nodeAbsent
-
jsonSource
-
jsonSource
-
getPathPrefix
-
wrapDeserializedObject
Wraps deserialized object - supports null, String, numbers, maps, lists, ... -
missingNode
-