use of weibo4j.org.json.JSONArray in project twitter-2-weibo by rjyo.
the class Favorites method constructFavorites.
public static List<Favorites> constructFavorites(Response res) throws WeiboException {
try {
JSONArray list = res.asJSONObject().getJSONArray("favorites");
int size = list.length();
List<Favorites> favorites = new ArrayList<Favorites>(size);
for (int i = 0; i < size; i++) {
favorites.add(new Favorites(list.getJSONObject(i)));
}
totalNumber = res.asJSONObject().getInt("total_number");
return favorites;
} catch (JSONException jsone) {
throw new WeiboException(jsone);
}
}
use of weibo4j.org.json.JSONArray in project twitter-2-weibo by rjyo.
the class FavoritesTag method constructTag.
public static List<FavoritesTag> constructTag(Response res) throws WeiboException {
try {
JSONArray list = res.asJSONObject().getJSONArray("tags");
int size = list.length();
List<FavoritesTag> tags = new ArrayList<FavoritesTag>(size);
for (int i = 0; i < size; i++) {
tags.add(new FavoritesTag(list.getJSONObject(i)));
}
return tags;
} catch (JSONException jsone) {
throw new WeiboException(jsone);
} catch (WeiboException te) {
throw te;
}
}
use of weibo4j.org.json.JSONArray in project twitter-2-weibo by rjyo.
the class School method constructSchool.
public static List<School> constructSchool(Response res) throws WeiboException {
try {
JSONArray list = res.asJSONArray();
int size = list.length();
List<School> schools = new ArrayList<School>(size);
for (int i = 0; i < size; i++) {
schools.add(new School(list.getJSONObject(i)));
}
return schools;
} catch (JSONException jsone) {
throw new WeiboException(jsone);
} catch (WeiboException te) {
throw te;
}
}
use of weibo4j.org.json.JSONArray in project twitter-2-weibo by rjyo.
the class Tag method constructTags.
public static List<Tag> constructTags(Response res) throws WeiboException {
try {
JSONArray list = res.asJSONArray();
int size = list.length();
List<Tag> tags = new ArrayList<Tag>(size);
for (int i = 0; i < size; i++) {
tags.add(new Tag(list.getJSONObject(i)));
}
return tags;
} catch (JSONException jsone) {
throw new WeiboException(jsone);
} catch (WeiboException te) {
throw te;
}
}
use of weibo4j.org.json.JSONArray in project twitter-2-weibo by rjyo.
the class Tag method constructTag.
public static List<FavoritesTag> constructTag(Response res) throws WeiboException {
try {
JSONArray list = res.asJSONObject().getJSONArray("tags");
int size = list.length();
List<FavoritesTag> tags = new ArrayList<FavoritesTag>(size);
for (int i = 0; i < size; i++) {
tags.add(new FavoritesTag(list.getJSONObject(i)));
}
return tags;
} catch (JSONException jsone) {
throw new WeiboException(jsone);
} catch (WeiboException te) {
throw te;
}
}
Aggregations