Package org.boris.expr

Examples of org.boris.expr.ExprException


        if (arg instanceof ExprNumber) {
            return ((ExprNumber) arg).doubleValue();
        }
        if (!strict)
            return 0;
        throw new ExprException("Invalid argument type for function " +
                getClass().getSimpleName());
    }
View Full Code Here


        if (arg instanceof ExprNumber) {
            return ((ExprNumber) arg).intValue();
        }
        if (!strict)
            return 0;
        throw new ExprException("Invalid argument type for function " +
                getClass().getSimpleName());
    }
View Full Code Here

        if (arg instanceof ExprNumber) {
            return ((ExprNumber) arg).booleanValue();
        }
        if (!strict)
            return false;
        throw new ExprException("Invalid argument type for function " +
                getClass().getSimpleName());
    }
View Full Code Here

            if (arg instanceof ExprNumber) {
                return arg.toString();
            }
            return "";
        }
        throw new ExprException("Invalid argument type for function " +
                getClass().getSimpleName());
    }
View Full Code Here

    }

    protected void assertArgType(Expr expr, ExprType type) throws ExprException {
        if (expr == null) {
            if (type != null)
                throw new ExprException("Invalid empty argument for function " +
                        getClass().getSimpleName());

        } else {
            if (!expr.type.equals(type)) {
                throw new ExprException("Invalid argument type for function " +
                        getClass().getSimpleName());
            }
        }
    }
View Full Code Here

    }

    protected void assertMinArgCount(Expr[] args, int count)
            throws ExprException {
        if (args.length < count)
            throw new ExprException("Too few arguments to function " +
                    getClass().getSimpleName());
    }
View Full Code Here

    }

    protected void assertMaxArgCount(Expr[] args, int count)
            throws ExprException {
        if (args.length > count)
            throw new ExprException("Too many arguments to function " +
                    getClass().getSimpleName());
    }
View Full Code Here

        if (expr instanceof ExprArray) {
            return (ExprArray) expr;
        }

        if (strict)
            throw new ExprException("Argument not an array for function: " +
                    getClass().getSimpleName());

        ExprArray ea = new ExprArray(1, 1);
        ea.set(0, expr);
        return ea;
View Full Code Here

        int y1 = dim1.getRow();
        int y2 = dim2 == null ? y1 : dim2.getRow();
        int width = x2 - x1 + 1;
        int height = y2 - y1 + 1;
        if (width <= 0 || height <= 0)
            throw new ExprException("Invalid range: " + range);
    }
View Full Code Here

            ExprParser p = new ExprParser();
            p.setParserVisitor(this);
            try {
                p.parse(new ExprLexer(expression), this);
            } catch (IOException e) {
                throw new ExprException(e);
            }
            result = p.get();
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of org.boris.expr.ExprException

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.