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<Place> places = new ResponseListImpl<Place>(size, json);
            for (int i = 0; i < size; i++) {
                JSONObject placeJSONObject = list.getJSONObject(i);
                Place place = new PlaceJSONImpl(placeJSONObject);
                if (conf.isJSONStoreEnabled()) {
                    DataObjectFactoryUtil.registerJSONObject(place, placeJSONObject);
                }
                places.add(place);
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<Poke> pokes = new ResponseListImpl<Poke>(size, json);
            for (int i = 0; i < size; i++) {
                JSONObject pokeJSONObject = list.getJSONObject(i);
                Poke poke = new PokeJSONImpl(pokeJSONObject);
                if (conf.isJSONStoreEnabled()) {
                    DataObjectFactoryUtil.registerJSONObject(poke, pokeJSONObject);
                }
                pokes.add(poke);
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<FriendRequest> friendRequests = new ResponseListImpl<FriendRequest>(size, json);
            for (int i = 0; i < size; i++) {
                JSONObject friendRequestJSONObject = list.getJSONObject(i);
                FriendRequest friendRequest = new FriendRequestJSONImpl(friendRequestJSONObject);
                if (conf.isJSONStoreEnabled()) {
                    DataObjectFactoryUtil.registerJSONObject(friendRequest, friendRequestJSONObject);
                }
                friendRequests.add(friendRequest);
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<Offer> offers = new ResponseListImpl<Offer>(size, json);
            for (int i = 0; i < size; i++) {
                JSONObject offerJSONObject = list.getJSONObject(i);
                Offer offer = new OfferJSONImpl(offerJSONObject);
                if (conf.isJSONStoreEnabled()) {
                    DataObjectFactoryUtil.registerJSONObject(offer, offerJSONObject);
                }
                offers.add(offer);
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<PageSetting> settings = new ResponseListImpl<PageSetting>(size, json);
            for (int i = 0; i < size; i++) {
                PageSetting setting = new PageSettingJSONImpl(list.getJSONObject(i));
                settings.add(setting);
            }
            if (conf.isJSONStoreEnabled()) {
                DataObjectFactoryUtil.registerJSONObject(settings, 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<Comment> comments = new ResponseListImpl<Comment>(size, json);
            for (int i = 0; i < size; i++) {
                JSONObject commentJSONObject = list.getJSONObject(i);
                Comment comment = new CommentJSONImpl(commentJSONObject);
                if (conf.isJSONStoreEnabled()) {
                    DataObjectFactoryUtil.registerJSONObject(comment, commentJSONObject);
                }
                comments.add(comment);
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<GroupDoc> docs = new ResponseListImpl<GroupDoc>(size, json);
            for (int i = 0; i < size; i++) {
                JSONObject groupDocJSONObject = list.getJSONObject(i);
                GroupDoc doc = new GroupDocJSONImpl(groupDocJSONObject);
                if (conf.isJSONStoreEnabled()) {
                    DataObjectFactoryUtil.registerJSONObject(doc, groupDocJSONObject);
                }
                docs.add(doc);
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<Tab> tabs = new ResponseListImpl<Tab>(size, json);
            for (int i = 0; i < size; i++) {
                JSONObject tabJSONObject = list.getJSONObject(i);
                Tab tab = new TabJSONImpl(tabJSONObject);
                if (conf.isJSONStoreEnabled()) {
                    DataObjectFactoryUtil.registerJSONObject(tab, tabJSONObject);
                }
                tabs.add(tab);
View Full Code Here

                JSONObject fromJSONObject = json.getJSONObject("from");
                from = new CategoryJSONImpl(fromJSONObject);
            }
            if (!json.isNull("tags")) {
                JSONObject tagsJSONObject = json.getJSONObject("tags");
                JSONArray list = tagsJSONObject.getJSONArray("data");
                final int size = list.length();
                tags = new PagableListImpl<Tag>(size, tagsJSONObject);
                for (int i = 0; i < size; i++) {
                    TagJSONImpl tag = new TagJSONImpl(list.getJSONObject(i));
                    tags.add(tag);
                }
            } else {
                tags = new PagableListImpl<Tag>();
            }
            name = getRawString("name", json);
            icon = getURL("icon", json);
            picture = getURL("picture", json);
            source = getURL("source", json);
            if (!json.isNull("height")) {
                height = getPrimitiveInt("height", json);
            }
            if (!json.isNull("width")) {
                width = getPrimitiveInt("width", json);
            }
            if (!json.isNull("images")) {
                images = new ArrayList<Photo.Image>();
                JSONArray imagesJSONArray = json.getJSONArray("images");
                for (int i = 0; i < imagesJSONArray.length(); i++) {
                    JSONObject image = imagesJSONArray.getJSONObject(i);
                    images.add(new PhotoJSONImpl.ImageJSONImpl(image));
                }
            } else {
                images = Collections.emptyList();
            }
            link = getURL("link", json);
            if (!json.isNull("place")) {
                JSONObject placeJSONObject = json.getJSONObject("place");
                place = new PlaceJSONImpl(placeJSONObject);
            }
            createdTime = getISO8601Datetime("created_time", json);
            updatedTime = getISO8601Datetime("updated_time", json);
            if (!json.isNull("position")) {
                position = getPrimitiveInt("position", json);
            }
            if (!json.isNull("comments")) {
                JSONObject commentsJSONObject = json.getJSONObject("comments");
                if (!commentsJSONObject.isNull("data")) {
                    JSONArray list = commentsJSONObject.getJSONArray("data");
                    final int size = list.length();
                    comments = new PagableListImpl<Comment>(size, commentsJSONObject);
                    for (int i = 0; i < size; i++) {
                        CommentJSONImpl comment = new CommentJSONImpl(list.getJSONObject(i));
                        comments.add(comment);
                    }
                } else {
                    comments = new PagableListImpl<Comment>(1, commentsJSONObject);
                }
            } else {
                comments = new PagableListImpl<Comment>(0);
            }
            if (!json.isNull("likes")) {
                JSONObject likesJSONObject = json.getJSONObject("likes");
                if (!likesJSONObject.isNull("data")) {
                    JSONArray list = likesJSONObject.getJSONArray("data");
                    final int size = list.length();
                    likes = new PagableListImpl<Like>(size, likesJSONObject);
                    for (int i = 0; i < size; i++) {
                        LikeJSONImpl like = new LikeJSONImpl(list.getJSONObject(i));
                        likes.add(like);
                    }
                } else {
                    likes = new PagableListImpl<Like>(1, likesJSONObject);
                }
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<Photo> photos = new ResponseListImpl<Photo>(size, json);
            for (int i = 0; i < size; i++) {
                JSONObject photoJSONObject = list.getJSONObject(i);
                Photo photo = new PhotoJSONImpl(photoJSONObject);
                if (conf.isJSONStoreEnabled()) {
                    DataObjectFactoryUtil.registerJSONObject(photo, photoJSONObject);
                }
                photos.add(photo);
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.