Package org.apache.wink.json4j.compat

Examples of org.apache.wink.json4j.compat.JSONException.initCause()


            }
            array.put(value);
            return put(key,array);
        } catch (Exception ex) {
            JSONException jex = new JSONException(ex.getMessage());
            jex.initCause(ex);
            throw jex;
        }
    }

    public JSONObject put(String key, boolean value) {
View Full Code Here


    public JSONObject put(String key, Collection value) throws JSONException{
        try {
            delegate.put(key, value);
        } catch (Exception ex){
            JSONException jex = new JSONException(ex.getMessage());
            jex.initCause(ex);
            throw jex;
        }
        return this;
    }
View Full Code Here

    public JSONObject put(String key, Map value) throws JSONException{
        try {
            delegate.put(key, value);
        } catch (Exception ex){
            JSONException jex = new JSONException(ex.getMessage());
            jex.initCause(ex);
            throw jex;
        }
        return this;
    }
View Full Code Here

        if(value == null) {
            try {
                delegate.put(key, value);
            } catch (Exception ex) {
                JSONException jex = new JSONException(ex.getMessage());
                jex.initCause(ex);
                throw jex;
            }
        } else {
            try{
                Class clazz = value.getClass();
View Full Code Here

                } else if (String.class.isAssignableFrom(clazz)) {
                    this.delegate.put(key, value);
                }
            } catch (Exception ex) {
                JSONException jex = new JSONException(ex.getMessage());
                jex.initCause(ex);
                throw jex;
            }
        }
        return this;
    }
View Full Code Here

    public Writer write(Writer w) throws JSONException {
        try {
            delegate.write(w);
        } catch (Exception ex){
            JSONException jex = new JSONException(ex.getMessage());
            jex.initCause(ex);
            throw jex;
        }
        return w;
    }
}
View Full Code Here

    public boolean getBoolean(int index) throws JSONException {
        try {
            return delegate.getBoolean(index);
        } catch (Exception ex) {
            JSONException jex = new JSONException(ex.getMessage());
            jex.initCause(ex);
            throw jex;
        }
    }

    public double getDouble(int index) throws JSONException {
View Full Code Here

    public double getDouble(int index) throws JSONException {
        try {
            return delegate.getDouble(index);
        } catch (Exception ex) {
            JSONException jex = new JSONException(ex.getMessage());
            jex.initCause(ex);
            throw jex;
        }
    }

    public int getInt(int index) throws JSONException {
View Full Code Here

    public int getInt(int index) throws JSONException {
        try {
            return delegate.getInt(index);
        } catch (Exception ex) {
            JSONException jex = new JSONException(ex.getMessage());
            jex.initCause(ex);
            throw jex;
        }
    }

    public long getLong(int index) throws JSONException {
View Full Code Here

    public long getLong(int index) throws JSONException {
        try {
            return delegate.getLong(index);
        } catch (Exception ex) {
            JSONException jex = new JSONException(ex.getMessage());
            jex.initCause(ex);
            throw jex;
        }
    }

    public short getShort(int index) throws JSONException {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.