org.exoplatform.social.client.core.util
Class SocialJSONDecodingSupport

java.lang.Object
  extended by org.exoplatform.social.client.core.util.SocialJSONDecodingSupport

public class SocialJSONDecodingSupport
extends Object

Created by The eXo Platform SAS Author : eXoPlatform exo@exoplatform.com Jun 30, 2011


Constructor Summary
SocialJSONDecodingSupport()
           
 
Method Summary
static
<T extends Model>
List<T>
JSONArrayObjectParser(Class<T> clazz, org.apache.http.HttpResponse response)
           
static
<T extends Model>
List<T>
JSONArrayObjectParser(Class<T> clazz, String jsonArrayContent)
           
static
<T extends Model>
T
parser(Class<T> clazz, org.apache.http.HttpResponse response)
          Parse JSON text into java Model object from the input source.
static
<T extends Model>
T
parser(Class<T> clazz, String jsonContent)
          Parse JSON text into java Model object from the input source.
static Map parser(org.apache.http.HttpResponse response)
          HttpResponse text into java Map object from the input source.
static Map parser(String jsonContent)
          Parse JSON text into java Map object from the input source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocialJSONDecodingSupport

public SocialJSONDecodingSupport()
Method Detail

parser

public static <T extends Model> T parser(Class<T> clazz,
                                         String jsonContent)
                              throws org.json.simple.parser.ParseException
Parse JSON text into java Model object from the input source. and then it's base on the class type.

Type Parameters:
T - Generic type must extend from Model.
Parameters:
clazz - Class type.
jsonContent - Json content which you need to create the Model
Throws:
org.json.simple.parser.ParseException - Throw this exception if any

parser

public static <T extends Model> T parser(Class<T> clazz,
                                         org.apache.http.HttpResponse response)
                              throws IOException,
                                     org.json.simple.parser.ParseException
Parse JSON text into java Model object from the input source. and then it's base on the class type.

Type Parameters:
T - Generic type must extend from Model.
Parameters:
clazz - Class type.
response - HttpResponse which getting the JSONContent.
Throws:
org.json.simple.parser.ParseException - Throw this exception if any
IOException - Throw this exception if any

parser

public static Map parser(String jsonContent)
                  throws org.json.simple.parser.ParseException
Parse JSON text into java Map object from the input source.

Parameters:
jsonContent - Json content which you need to create the Model
Throws:
org.json.simple.parser.ParseException - Throw this exception if any

parser

public static Map parser(org.apache.http.HttpResponse response)
                  throws org.json.simple.parser.ParseException
HttpResponse text into java Map object from the input source.

Parameters:
response - HttpResponse to get the content.
Throws:
org.json.simple.parser.ParseException - Throw this exception if any

JSONArrayObjectParser

public static <T extends Model> List<T> JSONArrayObjectParser(Class<T> clazz,
                                                              org.apache.http.HttpResponse response)
                                                   throws IOException,
                                                          org.json.simple.parser.ParseException
Type Parameters:
T -
Parameters:
clazz -
response -
Returns:
Throws:
IOException
org.json.simple.parser.ParseException

JSONArrayObjectParser

public static <T extends Model> List<T> JSONArrayObjectParser(Class<T> clazz,
                                                              String jsonArrayContent)
                                                   throws IOException,
                                                          org.json.simple.parser.ParseException
Type Parameters:
T -
Parameters:
clazz -
jsonArrayContent -
Returns:
Throws:
IOException
org.json.simple.parser.ParseException


Copyright © 2011 eXo Platform. All Rights Reserved.