Package cc.concurrent.mango.exception

Examples of cc.concurrent.mango.exception.IncorrectParameterTypeException


        if (num == 1) {
            Type shardType = getTypeContext().getPropertyType(shardParameterName, shardPropertyPath);
            TypeToken typeToken = new TypeToken(shardType);
            Class<?> mappedClass = typeToken.getMappedClass();
            if (mappedClass == null || typeToken.isIterable()) {
                throw new IncorrectParameterTypeException("the type of parameter Modified @ShardBy is error, " +
                        "type is " + shardType);
            }
        }
    }
View Full Code Here


        }
        Type type = method.getGenericParameterTypes()[0];
        TypeToken typeToken = new TypeToken(type);
        Class<?> mappedClass = typeToken.getMappedClass();
        if (mappedClass == null || !typeToken.isIterable()) {
            throw new IncorrectParameterTypeException("parameter of batch update " +
                    "expected array or implementations of java.util.List or implementations of java.util.Set " +
                    "but " + type); // 批量更新的参数必须可迭代
        }
        return new Type[]{mappedClass};
    }
View Full Code Here

        Type type = method.getGenericParameterTypes()[0];
        TypeToken typeToken = new TypeToken(type);
        Class<?> mappedClass = typeToken.getMappedClass();
        if (mappedClass == null || !typeToken.isIterable()) {
            throw new IncorrectParameterTypeException("parameter of batch update " +
                    "expected array or implementations of java.util.List or implementations of java.util.Set " +
                    "but " + type); // 批量更新的参数必须可迭代
        }

        TypeContext context = buildTypeContext(new Type[]{mappedClass});
View Full Code Here

    public void checkType(TypeContext context) {
        Type type = context.getPropertyType(parameterName, propertyPath);
        TypeToken typeToken = new TypeToken(type);
        Class<?> mappedClass = typeToken.getMappedClass();
        if (mappedClass == null || typeToken.isIterable() || !JdbcUtils.isSingleColumnClass(mappedClass)) {
            throw new IncorrectParameterTypeException("invalid type of " + fullName + ", " +
                    "expected a class can be identified by jdbc but " + type);
        }
    }
View Full Code Here

        do {
            node = node.jjtGetParent();
        } while (!(node instanceof ASTExpression) && (node instanceof ASTAddExpression));
        if (node instanceof ASTExpression) { // 到达根节点都是加法
            if (!Integer.class.equals(type) && !int.class.equals(type) && !String.class.equals(type)) {
                throw new IncorrectParameterTypeException("invalid type of " + fullName + ", " +
                        "expected int or java.lang.Integer or java.lang.String but " + type);
            }
        } else { // 到达根节点的途中遇到了非加法
            if (!Integer.class.equals(type) && !int.class.equals(type)) {
                throw new IncorrectParameterTypeException("invalid type of " + fullName + ", " +
                        "expected int or java.lang.Integer but " + type);
            }
        }
    }
View Full Code Here

    public void checkType(TypeContext context) {
        Type type = context.getPropertyType(parameterName, propertyPath);
        TypeToken typeToken = new TypeToken(type);
        Class<?> mappedClass = typeToken.getMappedClass();
        if (!typeToken.isIterable()) { // 不是集合或数组抛出异常
            throw new IncorrectParameterTypeException("invalid type of " + fullName + ", " +
                    "expected array or implementations of java.util.List or implementations of java.util.Set " +
                    "but " + type);
        }
        if (mappedClass == null || !JdbcUtils.isSingleColumnClass(mappedClass)) {
            String s = typeToken.isArray() ? "component" : "actual";
            throw new IncorrectParameterTypeException("invalid " + s + " type of " + fullName + ", " +
                    s + " type of " + fullName + " expected a class can be identified by jdbc " +
                    "but " + typeToken.getMappedType());
        }
    }
View Full Code Here

        }
        Type type = method.getGenericParameterTypes()[0];
        TypeToken typeToken = new TypeToken(type);
        Class<?> mappedClass = typeToken.getMappedClass();
        if (mappedClass == null || !typeToken.isIterable()) {
            throw new IncorrectParameterTypeException("parameter of batch update " +
                    "expected array or implementations of java.util.List or implementations of java.util.Set " +
                    "but " + type); // 批量更新的参数必须可迭代
        }
        return new Type[]{mappedClass};
    }
View Full Code Here

    public void checkType(TypeContext context) {
        Type type = context.getPropertyType(parameterName, propertyPath);
        TypeToken typeToken = new TypeToken(type);
        Class<?> mappedClass = typeToken.getMappedClass();
        if (!typeToken.isIterable()) { // 不是集合或数组抛出异常
            throw new IncorrectParameterTypeException("invalid type of " + fullName + ", " +
                    "expected array or implementations of java.util.List or implementations of java.util.Set " +
                    "but " + type);
        }
        if (mappedClass == null || !JdbcUtils.isSingleColumnClass(mappedClass)) {
            String s = typeToken.isArray() ? "component" : "actual";
            throw new IncorrectParameterTypeException("invalid " + s + " type of " + fullName + ", " +
                    s + " type of " + fullName + " expected a class can be identified by jdbc " +
                    "but " + typeToken.getMappedType());
        }
    }
View Full Code Here

    public void checkType(TypeContext context) {
        Type type = context.getPropertyType(parameterName, propertyPath);
        TypeToken typeToken = new TypeToken(type);
        Class<?> mappedClass = typeToken.getMappedClass();
        if (mappedClass == null || typeToken.isIterable() || !JdbcUtils.isSingleColumnClass(mappedClass)) {
            throw new IncorrectParameterTypeException("invalid type of " + fullName + ", " +
                    "expected a class can be identified by jdbc but " + type);
        }
    }
View Full Code Here

        do {
            node = node.jjtGetParent();
        } while (!(node instanceof ASTExpression) && (node instanceof ASTAddExpression));
        if (node instanceof ASTExpression) { // 到达根节点都是加法
            if (!Integer.class.equals(type) && !int.class.equals(type) && !String.class.equals(type)) {
                throw new IncorrectParameterTypeException("invalid type of " + fullName + ", " +
                        "expected int or java.lang.Integer or java.lang.String but " + type);
            }
        } else { // 到达根节点的途中遇到了非加法
            if (!Integer.class.equals(type) && !int.class.equals(type)) {
                throw new IncorrectParameterTypeException("invalid type of " + fullName + ", " +
                        "expected int or java.lang.Integer but " + type);
            }
        }
    }
View Full Code Here

TOP

Related Classes of cc.concurrent.mango.exception.IncorrectParameterTypeException

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.