Package facebook4j.internal.org.json

Examples of facebook4j.internal.org.json.JSONObject


    static ResponseList<Friend> createFriendList(HttpResponse res, Configuration conf) throws FacebookException {
        try {
            if (conf.isJSONStoreEnabled()) {
                DataObjectFactoryUtil.clearThreadLocalMap();
            }
            JSONObject json = res.asJSONObject();
            JSONArray list = json.getJSONArray("data");
            final int size = list.length();
            ResponseList<Friend> friends = new ResponseListImpl<Friend>(size, json);
            for (int i = 0; i < size; i++) {
                JSONObject friendJSONObject = list.getJSONObject(i);
                Friend friend = new FriendJSONImpl(friendJSONObject);
                if (conf.isJSONStoreEnabled()) {
                    DataObjectFactoryUtil.registerJSONObject(friend, friendJSONObject);
                }
                friends.add(friend);
View Full Code Here


    private JSONObject json = null;

    public JSONObject asJSONObject() {
        if (json == null) {
            json = new JSONObject(this);
        }
        return json;
    }
View Full Code Here

    private JSONObject json = null;

    public JSONObject asJSONObject() {
        if (json == null) {
            json = new JSONObject(this);
        }
        return json;
    }
View Full Code Here

        return name;
    }

    protected void fillInIDAndName() throws FacebookException {
        ensureAuthorizationEnabled();
        JSONObject json = http.get(conf.getRestBaseURL() + "me?fields=id,name", auth).asJSONObject();
        try {
            this.id = json.getString("id");
            this.name = json.getString("name");
        } catch (JSONException jsone) {
            throw new FacebookException(jsone);
        }
    }
View Full Code Here

     * @return Account
     * @throws FacebookException when provided string is not a valid JSON string.
     */
    public static Account createAccount(String rawJSON) throws FacebookException {
        try {
            JSONObject json = new JSONObject(rawJSON);
            return accountConstructor.newInstance(json);
        } catch (InstantiationException e) {
            throw new FacebookException(e);
        } catch (IllegalAccessException e) {
            throw new AssertionError(e);
View Full Code Here

     * @return Achievement
     * @throws FacebookException when provided string is not a valid JSON string.
     */
    public static Achievement createAchievement(String rawJSON) throws FacebookException {
        try {
            JSONObject json = new JSONObject(rawJSON);
            return achievementConstructor.newInstance(json);
        } catch (InstantiationException e) {
            throw new FacebookException(e);
        } catch (IllegalAccessException e) {
            throw new AssertionError(e);
View Full Code Here

     * @return Activity
     * @throws FacebookException when provided string is not a valid JSON string.
     */
    public static Activity createActivity(String rawJSON) throws FacebookException {
        try {
            JSONObject json = new JSONObject(rawJSON);
            return activityConstructor.newInstance(json);
        } catch (InstantiationException e) {
            throw new FacebookException(e);
        } catch (IllegalAccessException e) {
            throw new AssertionError(e);
View Full Code Here

     * @return Admin
     * @throws FacebookException when provided string is not a valid JSON string.
     */
    public static Admin createAdmin(String rawJSON) throws FacebookException {
        try {
            JSONObject json = new JSONObject(rawJSON);
            return adminConstructor.newInstance(json);
        } catch (InstantiationException e) {
            throw new FacebookException(e);
        } catch (IllegalAccessException e) {
            throw new AssertionError(e);
View Full Code Here

     * @return Album
     * @throws FacebookException when provided string is not a valid JSON string.
     */
    public static Album createAlbum(String rawJSON) throws FacebookException {
        try {
            JSONObject json = new JSONObject(rawJSON);
            return albumConstructor.newInstance(json);
        } catch (InstantiationException e) {
            throw new FacebookException(e);
        } catch (IllegalAccessException e) {
            throw new AssertionError(e);
View Full Code Here

     * @return Book
     * @throws FacebookException when provided string is not a valid JSON string.
     */
    public static Book createBook(String rawJSON) throws FacebookException {
        try {
            JSONObject json = new JSONObject(rawJSON);
            return bookConstructor.newInstance(json);
        } catch (InstantiationException e) {
            throw new FacebookException(e);
        } catch (IllegalAccessException e) {
            throw new AssertionError(e);
View Full Code Here

TOP

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

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.