Package com.volantis.xml.expression

Examples of com.volantis.xml.expression.ExpressionException


        if (argCount > 0) {
            value = arguments[0].stringValue().asJavaString();
            freshness =
                    (Freshness) DependencyRule.STRING_2_FRESHNESS.get(value);
            if (freshness == null) {
                throw new ExpressionException("Unknown freshness value: " +
                        value);
            }
        }

        if (argCount > 1) {
            // Get the revalidated.
            value = arguments[1].stringValue().asJavaString();
            revalidated =
                    (Freshness) DependencyRule.STRING_2_FRESHNESS.get(value);
            if (revalidated == null) {
                throw new ExpressionException(
                        "Unknown revalidated value: " + value);
            }
        }

        if (argCount > 2) {
View Full Code Here


                    result = currentItem;
                } else if (compareResult == CompareResult.INCOMPARABLE) {
                    if (result instanceof NumericValue && currentItem instanceof NumericValue) {
                        result = context.getFactory().createDoubleValue(Double.NaN);
                    } else {
                        throw new ExpressionException(
                                EXCEPTION_LOCALIZER.format(
                                        "incomparable-types",
                                        new Object[]{
                                            getName(),
                                            result.getClass().getName(),
View Full Code Here

            throws ExpressionException {

        int actualArgCount = (args != null) ? args.length : 0;

        if (actualArgCount != expectedArgCount) {
            throw new ExpressionException(
                    "Invalid argument count for function: " +
                    getFunctionName() +
                    " expected argument count: " + expectedArgCount +
                    " actual argument count: " + actualArgCount);
        }
View Full Code Here

    // javadoc inherited
    public Value invoke(ExpressionContext expressionContext, Value[] values)
        throws ExpressionException {

        if (values.length != 1) {
            throw new ExpressionException(EXCEPTION_LOCALIZER.format(
                "invalid-num-of-args",
                new Object[]{
                    NAME,
                    new Integer(1),
                    new Integer(values.length)}));
View Full Code Here

    public Value invoke(ExpressionContext context, Value[] arguments)
            throws ExpressionException {

        if (arguments.length != 1) {
            throw new ExpressionException(EXCEPTION_LOCALIZER.format(
                "invalid-num-of-args",
                new Object[]{NAME, 1, arguments.length}));
        }

        ExpressionFactory expressionFactory = context.getFactory();
View Full Code Here

                String string = val.stringValue().asJavaString();
                try {
                    double value = Double.parseDouble(string);
                    result = Math.round(value);
                } catch (NumberFormatException e){
                    throw new ExpressionException(e);
                }
            }
            return result;
        }
    }
View Full Code Here

     * @param actualCount actual number of arguments
     * @throws ExpressionException if validation of arguments fails
     */
    static void checkArgumentsCount(String functionName, int minCount, int maxCount, int actualCount) throws ExpressionException {
        if (actualCount < minCount || actualCount > maxCount) {
            throw new ExpressionException(EXCEPTION_LOCALIZER.format(
                    "invalid-num-args-range",
                    new Object[]{
                        functionName,
                        new Integer(minCount),
                        new Integer(maxCount),
View Full Code Here

     * @param actualCount actual number of arguments
     * @throws ExpressionException if validation of arguments fails
     */
    static void checkArgumentsCount(String functionName, int expectedCount, int actualCount) throws ExpressionException {
        if (actualCount != expectedCount) {
            throw new ExpressionException(EXCEPTION_LOCALIZER.format(
                    "invalid-num-args",
                    new Object[]{
                        functionName,
                        new Integer(expectedCount),
                        new Integer(actualCount)}));
View Full Code Here

    // javadoc inherited
    public Value invoke(ExpressionContext context, Value[] args)
            throws ExpressionException {
        if ((args.length != 2)) {
            throw new ExpressionException(
                    EXCEPTION_LOCALIZER.format(
                            "invalid-num-of-args",
                            new Object[]{new Integer(args.length),
                                    new Integer(2)}));
        }
View Full Code Here

    // javadoc inherited
    public Value invoke(ExpressionContext context, Value[] args)
            throws ExpressionException {
        if ((args.length != 2)) {
            throw new ExpressionException(
                    EXCEPTION_LOCALIZER.format(
                            "invalid-num-of-args",
                            new Object[]{new Integer(args.length),
                                    new Integer(2)}));
        }

        Value result = Sequence.EMPTY;

        if (args[0] != Sequence.EMPTY && args[1] != Sequence.EMPTY) {
            final String strToTokenize =
                    args[0].stringValue().asJavaString();
            final String pattern =
                    args[1].stringValue().asJavaString();

            if (pattern.length() == 0) {
                throw new ExpressionException(INVALID_PATTERN_MSG);
            }

            if (strToTokenize.length() == 0) {
                // If there is no input string, return the empty sequence.
                result = Sequence.EMPTY;
View Full Code Here

TOP

Related Classes of com.volantis.xml.expression.ExpressionException

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.