public class JsonGenerator extends Object
| Constructor and Description |
|---|
JsonGenerator() |
| Modifier and Type | Method and Description |
|---|---|
static JsonValue |
createJsonArray(Collection<?> collection)
Create JSON array from specified collection.
|
static JsonValue |
createJsonArray(Object array)
Create JSON array from specified object.
|
static JsonValue |
createJsonObject(Object object)
Create JSON object from specified object.
|
static JsonValue |
createJsonObjectFromMap(Map<String,?> map)
Create JSON object from specified map.
|
JsonValue |
createJsonObjectFromString(String s)
Create JSON object from specified string imply it is JSON object in String
format.
|
public static JsonValue createJsonArray(Collection<?> collection) throws JsonException
collection - source collectionJsonException - if collection can't be transformed in JSON
representationpublic static JsonValue createJsonArray(Object array) throws JsonException
array must
be array.array - source arrayJsonException - if array can't be transformed in JSON representationpublic static JsonValue createJsonObjectFromMap(Map<String,?> map) throws JsonException
map - source mapJsonException - if map can't be transformed in JSON representationpublic JsonValue createJsonObjectFromString(String s) throws JsonException
s - source stringJsonException - if map can't be transformed in JSON representationpublic static JsonValue createJsonObject(Object object) throws JsonException
object - source objectJsonException - if map can't be transformed in JSON representationCopyright © 2015. All rights reserved.