Examples of ExpressionFactory


Examples of javax.el.ExpressionFactory

    * Creates an {@link ValueExpression} for the supplied EL expression
    */
   private ValueExpression getValueExpression(FacesContext facesContext, String expression)
   {
      String el = toELExpression(expression);
      ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();
      return expressionFactory.createValueExpression(facesContext.getELContext(), el, Object.class);
   }
View Full Code Here

Examples of javax.el.ExpressionFactory

         if (Expressions.isEL(attribute))
         {
            FacesContext context = FacesContext.getCurrentInstance();
            Application app = context.getApplication();

            ExpressionFactory expressionFactory = app.getExpressionFactory();
            ValueExpression ve = expressionFactory.createValueExpression(attribute, Object.class);
            component.setValueExpression(attributeName, ve);
         }
         else
         {
            component.getAttributes().put(attributeName, attribute);
View Full Code Here

Examples of javax.el.ExpressionFactory

    @Test
    public void testCreateExtendedDataModel() {
        Assert.assertFalse(table.createExtendedDataModel() instanceof Arrangeable);
        List<Object> sortPriority = Arrays.<Object>asList("id2", "id0", "id1");
        List<UIComponent> children = table.getChildren();
        ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();
        ELContext elContext = facesContext.getELContext();
        UIColumn column = new UIColumn();
        column.setRendered(false);
        children.add(column);
        for (int i = 0; i < sortPriority.size(); i++) {
            UIColumn child = new UIColumn();
            child.setId("id" + i);
            child.setValueExpression("filterExpression",
                expressionFactory.createValueExpression(elContext, "#{'id" + i + "'}", Object.class));
            child.setValueExpression("sortBy",
                expressionFactory.createValueExpression(elContext, "#{'id" + i + "'}", Object.class));
            child.setSortOrder(SortOrder.ascending);
            children.add(child);
        }
        Assert.assertTrue(table.createExtendedDataModel() instanceof Arrangeable);
        MockArrangeableModel model = new MockArrangeableModel();
View Full Code Here

Examples of javax.el.ExpressionFactory

            Class<?> expectedType) {

        ValueExpression result = null;

        if (!literal && ELUtils.isValueReference(expression)) {
            ExpressionFactory expressionFactory = context.getApplication().getExpressionFactory();

            if (expressionFactory == null) {
                throw new IllegalStateException("ExpressionFactory is null");
            }

            result = expressionFactory.createValueExpression(context.getELContext(), expression, expectedType);
        } else {
            Object coercedValue = coerce(expression, expectedType);
            if (coercedValue != null) {
                result = new ConstantValueExpression(coercedValue);
            }
View Full Code Here

Examples of javax.el.ExpressionFactory

            validateFunctions(el, n);

            // test it out
            ELContextImpl ctx = new ELContextImpl();
            ctx.setFunctionMapper(this.getFunctionMapper(el));
            ExpressionFactory ef = this.pageInfo.getExpressionFactory();
            try {
                ef.createValueExpression(ctx, expr, Object.class);
            } catch (ELException e) {

            }
        }
View Full Code Here

Examples of javax.el.ExpressionFactory

    public final <T> T evaluateExpressionGet(final FacesContext context, final String expression,
                                             final Class<? extends T> expectedType) throws ELException
    {
        ELContext elContext = context.getELContext();

        ExpressionFactory factory = getExpressionFactory();

        return (T) factory.createValueExpression(elContext, expression, expectedType).getValue(elContext);
    }
View Full Code Here

Examples of javax.el.ExpressionFactory

    {
        assert _condition != null;

        if (_conditionExpression == null)
        {
            ExpressionFactory factory = context.getApplication().getExpressionFactory();
            _conditionExpression = factory.createValueExpression(context.getELContext(), _condition, Boolean.class);
        }

        return _conditionExpression;
    }
View Full Code Here

Examples of javax.el.ExpressionFactory

        }
    }

    public final ExpressionFactory createExpressionFactory()
    {
        ExpressionFactory el = null;
        el = (ExpressionFactory) this.featureInstance(EXPRESSION_FACTORY);
        if (el == null)
        {
            try
            {
View Full Code Here

Examples of javax.el.ExpressionFactory

                ValueExpression valueExpr = this.getValueExpression(ctx, MethodExpression.class);
                methodExpression = new ValueExpressionMethodExpression(valueExpr);
            }
            else
            {
                ExpressionFactory f = ctx.getExpressionFactory();
                methodExpression = f.createMethodExpression(ctx, this.value, type, paramTypes);
                   
                // if the MethodExpression contains a reference to the current composite
                // component, the Location also has to be stored in the MethodExpression
                // to be able to resolve the right composite component (the one that was
                // created from the file the Location is pointing to) later.
View Full Code Here

Examples of javax.el.ExpressionFactory

     */
    public ValueExpression getValueExpression(FaceletContext ctx, Class type)
    {
        try
        {
            ExpressionFactory f = ctx.getExpressionFactory();
            ValueExpression valueExpression = f.createValueExpression(ctx, this.value, type);
           
            // if the ValueExpression contains a reference to the current composite
            // component, the Location also has to be stored in the ValueExpression
            // to be able to resolve the right composite component (the one that was
            // created from the file the Location is pointing to) later.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.