Package javax.el

Examples of javax.el.ExpressionFactory.createValueExpression()


        assert _toViewId != null;

        if (_toViewIdExpression == null)
        {
            ExpressionFactory factory = context.getApplication().getExpressionFactory();
            _toViewIdExpression = factory.createValueExpression(context.getELContext(), _toViewId, String.class);
        }

        return _toViewIdExpression;
    }
View Full Code Here


  }

  public static ValueExpression createValueExpression(String string) {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();
    return expressionFactory.createValueExpression(facesContext.getELContext(), string, Object.class);
  }

  public static void setValidator(EditableValueHolder editableValueHolder, Object validator) {
    if (validator instanceof MethodExpression) {
      editableValueHolder.addValidator(new MethodExpressionValidator((MethodExpression) validator));
View Full Code Here

                            @Override
                            public Object run() throws Exception {
                                ELContextImpl ctx = (ELContextImpl) pageContext.getELContext();
                                ctx.setFunctionMapper(new FunctionMapperImpl(functionMap));
                                ValueExpression ve = exprFactory.createValueExpression(ctx, expression, expectedType);
                                return ve.getValue(ctx);
                            }
                        });
            } catch (PrivilegedActionException ex) {
                Exception realEx = ex.getException();
View Full Code Here

                }
            }
        } else {
            ELContextImpl ctx = (ELContextImpl) pageContext.getELContext();
            ctx.setFunctionMapper(new FunctionMapperImpl(functionMap));
            ValueExpression ve = exprFactory.createValueExpression(ctx, expression, expectedType);
            retValue = ve.getValue(ctx);
        }
        if (escape && retValue != null) {
            retValue = XmlEscape(retValue.toString());
        }
View Full Code Here

    {
        ELContext elContext = context.getELContext();

        ExpressionFactory factory = getExpressionFactory();

        return (T) factory.createValueExpression(elContext, expression, expectedType).getValue(elContext);
    }

    @Override
    public final void addELContextListener(final ELContextListener listener)
    {
View Full Code Here

      progressBar = createProgressBar(context, component);
    }
    progressBar.getAttributes().put("minValue", -1);
   
    ExpressionFactory expressionFactory = context.getApplication().getExpressionFactory();
    ValueExpression falseExpression = expressionFactory.createValueExpression(
        context.getELContext(),
        "#{" + Boolean.FALSE + "}",
        Boolean.class);
   
    progressBar.setValueExpression("enabled", falseExpression);
View Full Code Here

        assertEquals(ActionSequence.getSequenceData("create"), fooSingleton);
        assertEquals(ActionSequence.getSequenceData("destroy"), fooSingleton);
        ActionSequence.reset();

        // Create value expression and get value with supplied EL context (porting package)
        ValueExpression valueExpression = wrappedExpressionFactory.createValueExpression(null, "foo.test", String.class);
        Object valElResult = valueExpression.getValue(getCurrentConfiguration().getEl().createELContext(getCurrentManager()));
        assertNotNull(valElResult);
        assertTrue(valElResult instanceof Integer);
        assertEquals(valElResult, Integer.valueOf(-1));
View Full Code Here

        ExpressionFactory exprFactory =
            context.getApplication().getExpressionFactory();
        ELContext elContext = context.getELContext();

        String nameVal = (String)
                  exprFactory.createValueExpression(elContext, name, String.class)
                      .getValue(elContext);
        Object valueVal =
                exprFactory.createValueExpression(elContext, value, Object.class)
                    .getValue(elContext);
View Full Code Here

        String nameVal = (String)
                  exprFactory.createValueExpression(elContext, name, String.class)
                      .getValue(elContext);
        Object valueVal =
                exprFactory.createValueExpression(elContext, value, Object.class)
                    .getValue(elContext);

        if (component.getAttributes().get(nameVal) == null) {
            component.getAttributes().put(nameVal, valueVal);
        }
View Full Code Here

     * @return ValueExpression instance
     */
    public ValueExpression getValueExpression(FaceletContext ctx, Class type) {
        try {
            ExpressionFactory f = ctx.getExpressionFactory();
            return new TagValueExpression(this, f.createValueExpression(ctx,
                    this.value, type));
        } catch (Exception e) {
            throw new TagAttributeException(this, e);
        }
    }
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.