Class JsonGeneratorImpl
java.lang.Object
org.exoplatform.ws.frameworks.json.impl.JsonGeneratorImpl
- All Implemented Interfaces:
JsonGenerator
- Version:
- $Id: JsonGeneratorImpl.java 34417 2009-07-23 14:42:56Z dkatayev $
- Author:
- Andrey Parfonov
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateJsonArray(Object array) Create JSON array from specified object.createJsonArray(Collection<?> collection) Create JSON array from specified collection.createJsonObject(Object object) Create JSON object from specified object.createJsonObjectFromMap(Map<String, ?> map) Create JSON object from specified map.Create JSON object from specified string imply it is JSON object in String format.
-
Constructor Details
-
JsonGeneratorImpl
public JsonGeneratorImpl()
-
-
Method Details
-
createJsonArray
Create JSON array from specified collection.- Parameters:
collection- source collection- Returns:
- JSON representation of collection
- Throws:
JsonException- if collection can't be transformed in JSON representation
-
createJsonArray
Create JSON array from specified object. Parameterarraymust be array.- Parameters:
array- source array- Returns:
- JSON representation of array
- Throws:
JsonException- if array can't be transformed in JSON representation
-
createJsonObjectFromMap
Create JSON object from specified map.- Parameters:
map- source map- Returns:
- JSON representation of map
- Throws:
JsonException- if map can't be transformed in JSON representation
-
createJsonObjectFromString
Create JSON object from specified string imply it is JSON object in String format.- Parameters:
s- source string- Returns:
- JSON representation of map
- Throws:
JsonException- if map can't be transformed in JSON representation
-
createJsonObject
Create JSON object from specified object. Object must be conform with java bean structure.- Specified by:
createJsonObjectin interfaceJsonGenerator- Parameters:
object- source object- Returns:
- JSON representation of object
- Throws:
JsonException- if map can't be transformed in JSON representation
-