Examples of ArgumentErrorException


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

Examples of net.csdn.common.exception.ArgumentErrorException

    }

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

Examples of net.csdn.common.exception.ArgumentErrorException

        return (JSONObject) json;
    }

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

Examples of net.csdn.common.exception.ArgumentErrorException

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

        }

    }
View Full Code Here

Examples of net.csdn.common.exception.ArgumentErrorException

    }

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

Examples of net.csdn.common.exception.ArgumentErrorException

    }

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

Examples of net.csdn.common.exception.ArgumentErrorException

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

Examples of net.csdn.common.exception.ArgumentErrorException

    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

Examples of net.csdn.common.exception.ArgumentErrorException

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

Examples of net.csdn.common.exception.ArgumentErrorException

    }

    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
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.