public void fill(JSONArray from) { super.fill(from, parser); }
public VKApiUserFull parse(JSONObject user) { super.parse(user); // general last_seen = parseLong(user.optJSONObject(LAST_SEEN), "time"); bdate = user.optString(BDATE); JSONObject city = user.optJSONObject(CITY); if (city != null) { this.city = new VKApiCity().parse(city); } JSONObject country = user.optJSONObject(COUNTRY); if (country != null) { this.country = new VKApiCountry().parse(country); } // education universities = new VKList<VKApiUniversity>(user.optJSONArray(UNIVERSITIES), VKApiUniversity.class); schools = new VKList<VKApiSchool>(user.optJSONArray(SCHOOLS), VKApiSchool.class); // status activity = user.optString(ACTIVITY); JSONObject status_audio = user.optJSONObject("status_audio"); if (status_audio != null) this.status_audio = new VKApiAudio().parse(status_audio); // personal views JSONObject personal = user.optJSONObject(PERSONAL); if (personal != null) { smoking = personal.optInt("smoking"); alcohol = personal.optInt("alcohol"); political = personal.optInt("political"); life_main = personal.optInt("life_main"); people_main = personal.optInt("people_main"); inspired_by = personal.optString("inspired_by"); religion = personal.optString("religion"); if (personal.has("langs")) { JSONArray langs = personal.optJSONArray("langs"); if (langs != null) { this.langs = new String[langs.length()]; for (int i = 0; i < langs.length(); i++) { this.langs[i] = langs.optString(i); } } } } // contacts facebook = user.optString("facebook"); facebook_name = user.optString("facebook_name"); livejournal = user.optString("livejournal"); site = user.optString(SITE); screen_name = user.optString("screen_name", "id" + id); skype = user.optString("skype"); mobile_phone = user.optString("mobile_phone"); home_phone = user.optString("home_phone"); twitter = user.optString("twitter"); instagram = user.optString("instagram"); // personal info about = user.optString(ABOUT); activities = user.optString(ACTIVITIES); books = user.optString(BOOKS); games = user.optString(GAMES); interests = user.optString(INTERESTS); movies = user.optString(MOVIES); quotes = user.optString(QUOTES); tv = user.optString(TV); // settings nickname = user.optString("nickname", null); can_post = parseBoolean(user, CAN_POST); can_see_all_posts = parseBoolean(user, CAN_SEE_ALL_POSTS); blacklisted_by_me = parseBoolean(user, BLACKLISTED_BY_ME); can_write_private_message = parseBoolean(user, CAN_WRITE_PRIVATE_MESSAGE); wall_comments = parseBoolean(user, WALL_DEFAULT); String deactivated = user.optString("deactivated"); is_deleted = "deleted".equals(deactivated); is_banned = "banned".equals(deactivated); wall_default_owner = "owner".equals(user.optString(WALL_DEFAULT)); verified = parseBoolean(user, VERIFIED); // other sex = user.optInt(SEX); JSONObject counters = user.optJSONObject(COUNTERS); if (counters != null) this.counters = new Counters(counters); JSONObject occupation = user.optJSONObject(OCCUPATION); if (occupation != null) this.occupation = new Occupation(occupation); relation = user.optInt(RELATION); if (user.has(RELATIVES)) { if (relatives == null) { relatives = new VKList<Relative>(); } relatives.fill(user.optJSONArray(RELATIVES), Relative.class); } return this; }
public void fill(JSONObject from) { super.fill(from, parser); }