public final class JSONUtil extends Object
Modifier and Type | Method and Description |
---|---|
static org.jboss.dmr.ModelNode |
convert(com.fasterxml.jackson.databind.JsonNode node) |
static com.fasterxml.jackson.databind.JsonNode |
convert(org.jboss.dmr.ModelNode node) |
static boolean |
isNullOrUndefined(com.fasterxml.jackson.databind.JsonNode node) |
static com.fasterxml.jackson.databind.JsonNode |
parse(Reader reader) |
static com.fasterxml.jackson.databind.JsonNode |
parse(String string) |
static String |
stringifyJavascriptObject(Object object)
Converts the provided javascript object to JSON string.
|
static Reader |
stripComments(InputStream json)
Strips comments from the json in the inputstream.
|
static InputStream |
stripComments(InputStream json,
Charset charset)
Deprecated.
This ignores the charset and uses UTf-8. Use
stripComments(InputStream) instead. |
static Reader |
stripComments(Reader json) |
static String |
stripComments(String json) |
static org.jboss.dmr.ModelNode |
toModelNode(Object object) |
static String |
toString(com.fasterxml.jackson.databind.JsonNode json) |
public static com.fasterxml.jackson.databind.JsonNode convert(org.jboss.dmr.ModelNode node)
public static org.jboss.dmr.ModelNode convert(com.fasterxml.jackson.databind.JsonNode node)
public static com.fasterxml.jackson.databind.JsonNode parse(String string)
public static com.fasterxml.jackson.databind.JsonNode parse(Reader reader) throws IOException
IOException
public static String toString(com.fasterxml.jackson.databind.JsonNode json)
public static boolean isNullOrUndefined(@Nullable com.fasterxml.jackson.databind.JsonNode node)
@Deprecated public static InputStream stripComments(InputStream json, Charset charset)
stripComments(InputStream)
instead.json
- the JSON-encoded datacharset
- the charset of the datapublic static Reader stripComments(InputStream json)
json
- the JSON-encoded datapublic static String stripComments(String json)
json
- the JSON-encoded datapublic static Reader stripComments(Reader json)
json
- the JSON-encoded datapublic static String stringifyJavascriptObject(Object object)
If the object is a Map instance, it is stringified as key-value pairs, if it is a list, it is stringified as
a list, otherwise the object is merely converted to string using the toString()
method.
object
- the object to stringify.public static org.jboss.dmr.ModelNode toModelNode(Object object)
Copyright © 2014-2021 Lukas Krejci. All Rights Reserved.