eXo WS :: Framework :: JSON 2.4.0-Alpha1

org.exoplatform.ws.frameworks.json.impl
Class JsonGeneratorImpl

java.lang.Object
  extended by org.exoplatform.ws.frameworks.json.impl.JsonGeneratorImpl
All Implemented Interfaces:
JsonGenerator

public class JsonGeneratorImpl
extends Object
implements JsonGenerator

Version:
$Id: JsonGeneratorImpl.java 34417 2009-07-23 14:42:56Z dkatayev $
Author:
Andrey Parfonov

Constructor Summary
JsonGeneratorImpl()
           
 
Method Summary
 JsonValue createJsonArray(Collection<?> collection)
          Create JSON array from specified collection.
 JsonValue createJsonArray(Object array)
          Create JSON array from specified object.
 JsonValue createJsonObject(Object object)
          Create JSON object from specified object.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonGeneratorImpl

public JsonGeneratorImpl()
Method Detail

createJsonArray

public JsonValue createJsonArray(Collection<?> collection)
                          throws JsonException
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

public JsonValue createJsonArray(Object array)
                          throws JsonException
Create JSON array from specified object. Parameter array must be array.

Parameters:
array - source array
Returns:
JSON representation of array
Throws:
JsonException - if array can't be transformed in JSON representation

createJsonObjectFromMap

public JsonValue createJsonObjectFromMap(Map<String,?> map)
                                  throws JsonException
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

public JsonValue createJsonObjectFromString(String s)
                                     throws JsonException
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

public JsonValue createJsonObject(Object object)
                           throws JsonException
Create JSON object from specified object. Object must be conform with java bean structure.

Specified by:
createJsonObject in interface JsonGenerator
Parameters:
object - source object
Returns:
JSON representation of object
Throws:
JsonException - if map can't be transformed in JSON representation

eXo WS :: Framework :: JSON 2.4.0-Alpha1

Copyright © 2013 eXo Platform SAS. All Rights Reserved.