Package javax.faces.el

Examples of javax.faces.el.ReferenceSyntaxException


            valueExpression = getExpressionFactory().createValueExpression(
                    threadELContext(), reference, Object.class);
        }
        catch (ELException e)
        {
            throw new ReferenceSyntaxException(e);
        }

        return new ValueExpressionToValueBinding(valueExpression);
    }
View Full Code Here


        if (!(ref.startsWith("#{") && ref.endsWith("}"))) {
            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.fine(MessageFormat.format("Expression ''{0}'' does not follow the syntax #{...}", ref));
            }
            throw new ReferenceSyntaxException(ref);
        }
        FacesContext context = FacesContext.getCurrentInstance();
        MethodExpression result;
        try {
            // return a MethodBinding that wraps a MethodExpression.
            if (null == params) {
                params = RIConstants.EMPTY_CLASS_ARGS;
            }
            result =
                  getExpressionFactory().
                        createMethodExpression(context.getELContext(), ref, null,
                                               params);
        } catch (ELException elex) {
            throw new ReferenceSyntaxException(elex);
        }
        return (new MethodBindingMethodExpressionAdapter(result));

    }
View Full Code Here

         try {
             result= getExpressionFactory().
                     createValueExpression(context.getELContext(),ref,
                     Object.class);    
         } catch (ELException elex) {
            throw new ReferenceSyntaxException(elex);
         }
         return (new ValueBindingValueExpressionAdapter(result));

    }
View Full Code Here

        }
       
        // Do not trim(), we support mixed string-bindings
        if ((expression == null) || (expression.length() == 0))
        {
            throw new ReferenceSyntaxException("Expression: empty or null");
        }
        _application = application;
        _expressionString  = expression;

        _expression = s_expressionCache.get(expression);
View Full Code Here

        {
            Object expression = parser.ExpressionString();
            if (!(expression instanceof Expression)
                && !(expression instanceof ExpressionString))
            {
                throw new ReferenceSyntaxException("Invalid expression: '"
                    + expressionString
                    + "'. Parsed Expression of unexpected type "
                    + expression.getClass().getName());
            }

            replaceSuffixes(expression);

            return expression;
        }
        catch (ParseException e)
        {
            String msg = "Invalid expression: '" + expressionString + "'";
            log.debug(msg, e);
            throw new ReferenceSyntaxException(msg, e);
        }
    }
View Full Code Here

        // Loop through quoted strings
        for (;;)
        {
            if (i >= len)
            {
                throw new ReferenceSyntaxException(
                    "Missing closing brace. Expression: '" + expressionString
                        + "'");
            }

            int indexofClosingBrace = expressionString.indexOf('}', i);
            i = StringUtils.minIndex(indexofClosingBrace, findQuote(
                expressionString, i));

            if (i < 0)
            {
                // No delimiter found
                throw new ReferenceSyntaxException(
                    "Missing closing brace. Expression: '" + expressionString
                        + "'");
            }

            // 1. If quoted literal, find closing quote
            if (i != indexofClosingBrace)
            {
                i = indexOfMatchingClosingQuote(expressionString, i) + 1;
                if (i == 0)
                {
                    // Note: if no match, i==0 because -1 + 1 = 0
                    throw new ReferenceSyntaxException(
                        "Missing closing quote. Expression: '"
                            + expressionString + "'");
                }
            }
            else
View Full Code Here

        Integer integer = Coercions.coerceToInteger(index, LOGGER);
        if (integer != null)
        {
            return integer;
        }
        throw new ReferenceSyntaxException(
            "Cannot convert index to int for base " + base.getClass().getName()
                + " and index " + index);
    }
View Full Code Here

            {
                // Note: ArrayIndexOutOfBoundsException also here
                return null;
            }

            throw new ReferenceSyntaxException("Must be array or List. Bean: "
                + base.getClass().getName() + ", index " + index);
        }
        catch (RuntimeException e)
        {
            log.error("Exception getting value for index " + index
View Full Code Here

    public Object resolveVariable(FacesContext facesContext, String name)
    {
        if ((name == null) || (name.length() == 0))
        {
            throw new ReferenceSyntaxException("Varible name is null or empty");
        }

        // Implicit objects
        Object implicitObject = _implicitObjects.get(name);
        if (implicitObject != null)
View Full Code Here

        // TODO: this check should be performed by the expression factory. It is
        // a requirement of the TCK
        if (!(reference.startsWith("#{") && reference.endsWith("}")))
        {
            throw new ReferenceSyntaxException("Invalid method reference: '" + reference + "'");
        }

        if (params == null)
        {
            params = new Class[0];
        }

        MethodExpression methodExpression;

        try
        {
            methodExpression = getExpressionFactory().createMethodExpression(threadELContext(), reference,
                                                                             Object.class, params);
        }
        catch (ELException e)
        {
            throw new ReferenceSyntaxException(e);
        }

        return new MethodExpressionToMethodBinding(methodExpression);
    }
View Full Code Here

TOP

Related Classes of javax.faces.el.ReferenceSyntaxException

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.