fi.foyt.foursquare.api
类 JSONFieldParser

java.lang.Object
  继承者 fi.foyt.foursquare.api.JSONFieldParser

public class JSONFieldParser
extends Object

Class responsible of parsing API responses

作者:
Antti Leppä

方法摘要
static FoursquareEntity[] parseEntities(Class<?> clazz, org.json.JSONArray jsonArray, boolean skipNonExistingFields)
          Static method that parses JSON array into array of FoursquareEntities
static FoursquareEntity[] parseEntitiesHash(Class<?> clazz, org.json.JSONObject jsonHashList, boolean skipNonExistingFields)
          Static method that parses JSON "named array" into array of FoursquareEntities
static FoursquareEntity parseEntity(Class<?> clazz, org.json.JSONObject jsonObject, boolean skipNonExistingFields)
          Static method that parses single JSON Object into FoursquareEntity
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

方法详细信息

parseEntities

public static FoursquareEntity[] parseEntities(Class<?> clazz,
                                               org.json.JSONArray jsonArray,
                                               boolean skipNonExistingFields)
                                        throws FoursquareApiException
Static method that parses JSON array into array of FoursquareEntities

参数:
clazz - entity class
jsonArray - JSON Array
skipNonExistingFields - whether parser should ignore non-existing fields
返回:
list of entities
抛出:
FoursquareApiException - when something unexpected happens

parseEntitiesHash

public static FoursquareEntity[] parseEntitiesHash(Class<?> clazz,
                                                   org.json.JSONObject jsonHashList,
                                                   boolean skipNonExistingFields)
                                            throws FoursquareApiException
Static method that parses JSON "named array" into array of FoursquareEntities

参数:
clazz - entity class
jsonHashList - JSON "named array"
skipNonExistingFields - whether parser should ignore non-existing fields
返回:
list of entities
抛出:
FoursquareApiException - when something unexpected happens

parseEntity

public static FoursquareEntity parseEntity(Class<?> clazz,
                                           org.json.JSONObject jsonObject,
                                           boolean skipNonExistingFields)
                                    throws FoursquareApiException
Static method that parses single JSON Object into FoursquareEntity

参数:
clazz - entity class
jsonObject - JSON Object
skipNonExistingFields - whether parser should ignore non-existing fields
返回:
entity
抛出:
FoursquareApiException - when something unexpected happens


Copyright © 2013 Foyt. All Rights Reserved.