Package org.apache.wink.json4j.compat

Examples of org.apache.wink.json4j.compat.JSONArray


    }

    public JSONObject append(String key, Object value) throws JSONException {
        try {
            Object oldVal = this.delegate.get(key);
            JSONArray array = null;
            if (oldVal == null) {
                array = new org.apache.wink.json4j.compat.impl.ApacheJSONArrayDelegate(new org.apache.wink.json4j.JSONArray());
                if (this.has(key)) {
                    // Add a null if the key was actually there, but just
                    // had value of null.
                    array.put((Object)null);
                }
            } else if (org.apache.wink.json4j.compat.impl.ApacheJSONArrayDelegate.class.isAssignableFrom(oldVal.getClass())) {
                array = (JSONArray)oldVal;
            } else if (org.apache.wink.json4j.JSONArray.class.isAssignableFrom(oldVal.getClass())) {
                array = new org.apache.wink.json4j.compat.impl.ApacheJSONArrayDelegate((org.apache.wink.json4j.JSONArray)oldVal);
            } else {
                array = new org.apache.wink.json4j.compat.impl.ApacheJSONArrayDelegate(new org.apache.wink.json4j.JSONArray());
                array.put(oldVal);
            }
            array.put(value);
            return put(key,array);
        } catch (Exception ex) {
            JSONException jex = new JSONException(ex.getMessage());
            jex.initCause(ex);
            throw jex;
View Full Code Here

TOP

Related Classes of org.apache.wink.json4j.compat.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.