Package net.csdn.common.exception

Examples of net.csdn.common.exception.ArgumentErrorException


        Class clzz = null;
        try {
            clzz = Class.forName(model);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
            throw new ArgumentErrorException("error: could not load class:[" + model + "]");
        }
        return clzz;

    }
View Full Code Here


    }

    public JSONObject paramAsJSON() {
        JSON json = _contentAsJSON();
        if (json.isArray()) {
            throw new ArgumentErrorException("数据格式错误,您需要传入json格式");
        }
        return (JSONObject) json;
    }
View Full Code Here

        return (JSONObject) json;
    }

    public JSONArray paramsAsJSONArray() {
        JSON json = _contentAsJSON();
        if (!json.isArray()) throw new ArgumentErrorException("数据格式错误,您需要传入json格式");
        return (JSONArray) json;
    }
View Full Code Here

            return JSONObject.fromObject(contentAsString());
        } catch (Exception e) {
            try {
                return JSONArray.fromObject(contentAsString());
            } catch (Exception e1) {
                throw new ArgumentErrorException("数据格式错误,您需要传入json格式");
            }

        }

    }
View Full Code Here

    }

    public JSONArray paramAsXMLArray() {
        JSON json = _contentAsXML();
        if (!json.isArray()) throw new ArgumentErrorException("数据格式错误,您需要传入json格式");
        return (JSONArray) json;
    }
View Full Code Here

    }

    public JSONObject paramAsXML() {
        JSON json = _contentAsXML();
        if (json.isArray()) {
            throw new ArgumentErrorException("数据格式错误,您需要传入json格式");
        }
        return (JSONObject) json;
    }
View Full Code Here

        try {
            XMLSerializer xmlSerializer = new XMLSerializer();
            JSON json = xmlSerializer.read(contentAsString());
            return json;
        } catch (Exception e) {
            throw new ArgumentErrorException("数据格式错误,您需要传入json格式");
        }
    }
View Full Code Here

    public int paramAsInt(String key, int defaultValue) {
        return request.paramAsInt(key, defaultValue);
    }

    public int paramAsInt(String key) {
        if (param(key) == null) throw new ArgumentErrorException("");
        return request.paramAsInt(key, -1);
    }
View Full Code Here

                break;
            case HEAD:
                headHandlers.insert(path, handler);
                break;
            default:
                throw new ArgumentErrorException("Can't handle [" + method + "] for path [" + path + "]");
        }
    }
View Full Code Here

    }

    public void parse(Map<String, Object> params) {
        for (Map.Entry<String, Object> entry : params.entrySet()) {
            String[] keys = entry.getKey().split(keyPartDelimiter);
            if (keys.length > 2) throw new ArgumentErrorException("不支持超过三级层次的参数传递");
            if (keys.length == 1) {
                rootValues.put(keys[0], entry.getValue());
            } else {
                if (_children.get(keys[0]) == null) {
                    _children.put(keys[0], map(keys[1], entry.getValue()));
View Full Code Here

TOP

Related Classes of net.csdn.common.exception.ArgumentErrorException

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.