public final class JSONUtil extends Object
Modifier and Type | Method and Description |
---|---|
static String |
stringifyJavascriptObject(Object object)
Converts the provided javascript object to JSON string.
|
static InputStream |
stripComments(InputStream json,
Charset charset) |
static Reader |
stripComments(Reader json) |
static String |
stripComments(String json) |
static org.jboss.dmr.ModelNode |
toModelNode(Object object) |
public static InputStream stripComments(InputStream json, Charset charset)
json
- the JSON-encoded datacharset
- the charset of the 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-2020 Lukas Krejci. All Rights Reserved.