Package facebook4j.internal.org.json

Examples of facebook4j.internal.org.json.JSONArray


        try {
            if (conf.isJSONStoreEnabled()) {
                DataObjectFactoryUtil.clearThreadLocalMap();
            }
            JSONObject json = res.asJSONObject();
            JSONArray list = json.getJSONArray("data");
            final int size = list.length();
            ResponseList<User> users = new ResponseListImpl<User>(size, json);
            for (int i = 0; i < size; i++) {
                JSONObject userJSONObject = list.getJSONObject(i);
                User user = new UserJSONImpl(userJSONObject);
                if (conf.isJSONStoreEnabled()) {
                    DataObjectFactoryUtil.registerJSONObject(user, userJSONObject);
                }
                users.add(user);
View Full Code Here


                if (!json.isNull("degree")) {
                    JSONObject degreeJSON = json.getJSONObject("degree");
                    degree = new IdNameEntityJSONImpl(degreeJSON);
                }
                if (!json.isNull("concentration")) {
                    JSONArray concentrationJSONArray = json.getJSONArray("concentration");
                    concentration = new ArrayList<IdNameEntity>();
                    for (int i = 0; i < concentrationJSONArray.length(); i++) {
                        concentration.add(new IdNameEntityJSONImpl(concentrationJSONArray.getJSONObject(i)));
                    }
                } else {
                    concentration = Collections.emptyList();
                }
                if (!json.isNull("classes")) {
                    JSONArray classesJSONArray = json.getJSONArray("classes");
                    classes = new ArrayList<EducationClass>();
                    for (int i = 0; i < classesJSONArray.length(); i++) {
                        classes.add(new EducationClassJSONImpl(classesJSONArray.getJSONObject(i)));
                    }
                } else {
                    classes = Collections.emptyList();
                }
                if (!json.isNull("with")) {
                    JSONArray withJSONArray = json.getJSONArray("with");
                    with = new ArrayList<IdNameEntity>();
                    for (int i = 0; i < withJSONArray.length(); i++) {
                        with.add(new IdNameEntityJSONImpl(withJSONArray.getJSONObject(i)));
                    }
                } else {
                    with = Collections.emptyList();
                }
            } catch (JSONException jsone) {
View Full Code Here

       
        EducationClassJSONImpl(JSONObject json) throws FacebookException {
            try {
                if (!json.isNull("with")) {
                    JSONArray withJSONArray = json.getJSONArray("with");
                    with = new ArrayList<IdNameEntity>();
                    for (int i = 0; i < withJSONArray.length(); i++) {
                        with.add(new IdNameEntityJSONImpl(withJSONArray.getJSONObject(i)));
                    }
                } else {
                    with = Collections.emptyList();
                }
                description = getRawString("description", json);
View Full Code Here

        try {
            if (conf.isJSONStoreEnabled()) {
                DataObjectFactoryUtil.clearThreadLocalMap();
            }
            JSONObject json = res.asJSONObject();
            JSONArray list = json.getJSONArray("data");
            final int size = list.length();
            ResponseList<RSVPStatus> rsvpStatuses = new ResponseListImpl<RSVPStatus>(size, json);
            for (int i = 0; i < size; i++) {
                JSONObject rsvpStatusJSONObject = list.getJSONObject(i);
                RSVPStatus rsvpStatus = new RSVPStatusJSONImpl(rsvpStatusJSONObject);
                if (conf.isJSONStoreEnabled()) {
                    DataObjectFactoryUtil.registerJSONObject(rsvpStatus, rsvpStatusJSONObject);
                }
                rsvpStatuses.add(rsvpStatus);
View Full Code Here

    private void init(JSONObject json) throws FacebookException {
        try {
            id = getRawString("id", json);
            if (!json.isNull("votes")) {
                JSONObject votesJSONObject = json.getJSONObject("votes");
                JSONArray votesArray = votesJSONObject.getJSONArray("data");
                final int size = votesArray.length();
                votes = new PagableListImpl<IdNameEntity>(size, votesJSONObject);
                for (int i = 0; i < size; i++) {
                    IdNameEntityJSONImpl vote = new IdNameEntityJSONImpl(votesArray.getJSONObject(i));
                    votes.add(vote);
                }
            } else {
                votes = new PagableListImpl<IdNameEntity>(0);
            }
View Full Code Here

        try {
            if (conf.isJSONStoreEnabled()) {
                DataObjectFactoryUtil.clearThreadLocalMap();
            }
            JSONObject json = res.asJSONObject();
            JSONArray list = json.getJSONArray("data");
            final int size = list.length();
            ResponseList<QuestionVotes> questionVotesList = new ResponseListImpl<QuestionVotes>(size, json);
            for (int i = 0; i < size; i++) {
                JSONObject questionVotesJSONObject = list.getJSONObject(i);
                QuestionVotes questionVotes = new QuestionVotesJSONImpl(questionVotesJSONObject);
                if (conf.isJSONStoreEnabled()) {
                    DataObjectFactoryUtil.registerJSONObject(questionVotes, questionVotesJSONObject);
                }
                questionVotesList.add(questionVotes);
View Full Code Here

        id = getRawString("id", json);
        name = getRawString("name", json);
        role = getRawString("role", json);
        if (!json.isNull("perms")) {
            try {
                JSONArray permsJSONArray = json.getJSONArray("perms");
                final int size = permsJSONArray.length();
                perms = new ArrayList<String>(size);
                for (int i = 0; i < permsJSONArray.length(); i++) {
                    perms.add(permsJSONArray.getString(i));
                }
            } catch (JSONException jsone) {
                throw new FacebookException(jsone);
            }
        } else {
View Full Code Here

        try {
            if (conf.isJSONStoreEnabled()) {
                DataObjectFactoryUtil.clearThreadLocalMap();
            }
            JSONObject json = res.asJSONObject();
            JSONArray list = json.getJSONArray("data");
            final int size = list.length();
            ResponseList<Admin> admins = new ResponseListImpl<Admin>(size, json);
            for (int i = 0; i < size; i++) {
                JSONObject adminJSONObject = list.getJSONObject(i);
                Admin admin = new AdminJSONImpl(adminJSONObject);
                if (conf.isJSONStoreEnabled()) {
                    DataObjectFactoryUtil.registerJSONObject(admin, adminJSONObject);
                }
                admins.add(admin);
View Full Code Here

        try {
            if (conf.isJSONStoreEnabled()) {
                DataObjectFactoryUtil.clearThreadLocalMap();
            }
            JSONObject json = res.asJSONObject();
            JSONArray list = json.getJSONArray("data");
            final int size = list.length();
            ResponseList<Page> pages = new ResponseListImpl<Page>(size, json);
            for (int i = 0; i < size; i++) {
                Page page = new PageJSONImpl(list.getJSONObject(i));
                pages.add(page);
            }
            if (conf.isJSONStoreEnabled()) {
                DataObjectFactoryUtil.registerJSONObject(pages, json);
            }
View Full Code Here

        try {
            id = getRawString("id", json);
            name = getRawString("name", json);
           
            if (isJSONArray("category_list", json)) {
                JSONArray categoriesJSONArray = json.getJSONArray("category_list");
                categories = new ArrayList<Category>();
                for (int i = 0; i < categoriesJSONArray.length(); i++) {
                    categories.add(new CategoryJSONImpl(categoriesJSONArray.getJSONObject(i)));
                }
            }
           
            if (isJSONObject("location", json)) {
                JSONObject locationJSONObject = json.getJSONObject("location");
View Full Code Here

TOP

Related Classes of facebook4j.internal.org.json.JSONArray

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.