Package facebook4j.internal.org.json

Examples of facebook4j.internal.org.json.JSONArray


        if (jsonArray == null) {
            Reader reader = null;
            try {
                if (responseAsString == null) {
                    reader = asReader();
                    jsonArray = new JSONArray(new JSONTokener(reader));
                } else {
                    jsonArray = new JSONArray(responseAsString);
                }
                if (CONF.isPrettyDebugEnabled()) {
                    logger.debug(jsonArray.toString(1));
                } else {
                    logger.debug(responseAsString != null ? responseAsString :
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<Event> events = new ResponseListImpl<Event>(size, json);
            for (int i = 0; i < size; i++) {
                JSONObject eventJSONObject = list.getJSONObject(i);
                Event event = new EventJSONImpl(eventJSONObject);
                if (conf.isJSONStoreEnabled()) {
                    DataObjectFactoryUtil.registerJSONObject(event, eventJSONObject);
                }
                events.add(event);
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<IdNameEntity> entities = new ResponseListImpl<IdNameEntity>(size, json);
            for (int i = 0; i < size; i++) {
                JSONObject entityJSONObject = list.getJSONObject(i);
                IdNameEntity entity = new IdNameEntityJSONImpl(entityJSONObject);
                if (conf.isJSONStoreEnabled()) {
                    DataObjectFactoryUtil.registerJSONObject(entity, entityJSONObject);
                }
                entities.add(entity);
View Full Code Here

            assertThat(actual.isJSONObject(), is(false));
            assertThat(actual.isJSONArray(), is(true));
            assertThat(actual.isBoolean(), is(false));

            JSONArray jsonArray = actual.asJSONArray();
            assertThat(jsonArray.length(), is(2));
        }
View Full Code Here

        }
        if (description != null) {
            params.add(new HttpParameter("description", description));
        }
        if (actions != null && actions.size() != 0) {
            JSONArray jsonArray = new JSONArray(actions);
            params.add(new HttpParameter("actions", jsonArray.toString()));
        }
        if (place != null) {
            params.add(new HttpParameter("place", place));
        }
        if (tags != null) {
View Full Code Here

                JSONObject fromJSONObject = json.getJSONObject("from");
                from = new IdNameEntityJSONImpl(fromJSONObject);
            }
            if (!json.isNull("tags")) {
                JSONObject tagsJSONObject = json.getJSONObject("tags");
                JSONArray list = tagsJSONObject.getJSONArray("data");
                final int size = list.length();
                tags = new PagableListImpl<IdNameEntity>(size, tagsJSONObject);
                for (int i = 0; i < size; i++) {
                    IdNameEntityJSONImpl tag = new IdNameEntityJSONImpl(list.getJSONObject(i));
                    tags.add(tag);
                }
            } else {
                tags = 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<Location> locations = new ResponseListImpl<Location>(size, json);
            for (int i = 0; i < size; i++) {
                JSONObject locationJSONObject = list.getJSONObject(i);
                Location location = new LocationJSONImpl(locationJSONObject);
                if (conf.isJSONStoreEnabled()) {
                    DataObjectFactoryUtil.registerJSONObject(location, locationJSONObject);
                }
                locations.add(location);
View Full Code Here

            subject = getRawString("subject", json);
            message = getRawString("message", 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);
                }
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<Note> notes = new ResponseListImpl<Note>(size, json);
            for (int i = 0; i < size; i++) {
                JSONObject noteJSONObject = list.getJSONObject(i);
                Note note = new NoteJSONImpl(noteJSONObject);
                if (conf.isJSONStoreEnabled()) {
                    DataObjectFactoryUtil.registerJSONObject(note, noteJSONObject);
                }
                notes.add(note);
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<Interest> interests = new ResponseListImpl<Interest>(size, json);
            for (int i = 0; i < size; i++) {
                JSONObject interestJSONObject = list.getJSONObject(i);
                Interest interest = new InterestJSONImpl(interestJSONObject);
                if (conf.isJSONStoreEnabled()) {
                    DataObjectFactoryUtil.registerJSONObject(interest, interestJSONObject);
                }
                interests.add(interest);
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.