Package cn.com.byd.exceptions

Examples of cn.com.byd.exceptions.ParameterException


        int idx = 0;
        for (ParameterType paraType : parameters) {
            if (!StringUtil.isEmptyAndNull(paraType.getReferenceValue())) {
                obj = methodContext.getIdValue(paraType.getReferenceValue());
                if (!paraType.getClazz().equals(obj.getClass())) {
                    throw new ParameterException("parameter type not matching.args[" + idx + "],expect " + paraType.getClazz());
                }
                args[idx++] = obj;
            } else if (paraType.getBeanFieldMap() != null && !paraType.getBeanFieldMap().isEmpty()) {
                Map<String, Object> mapValue = new HashMap<String, Object>();
                for (String key : paraType.getBeanFieldMap().keySet()) {
View Full Code Here


     * @param arges
     * @throws ParameterException
     */
    public void checkParameters(Object... arges) throws ParameterException {
        if (arges.length != parameters.size()) {
            throw new ParameterException("parameter not matching.");
        }
        int idx = 0;
        // 验证参数类型是否一致
        for (Object obj : arges) {
            if (!obj.getClass().equals(parameters.get(idx).getClazz())) {
                throw new ParameterException("parameter[" + idx + "] type not matching.");
            }
            idx++;
        }
    }
View Full Code Here

TOP

Related Classes of cn.com.byd.exceptions.ParameterException

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.