Package javax.el

Examples of javax.el.ELContext


    }

    @Override
    public final Object evaluateExpressionGet(final FacesContext context, final String expression, final Class expectedType) throws ELException
    {
        ELContext elContext = context.getELContext();
        return getExpressionFactory().createValueExpression(elContext, expression, expectedType).getValue(elContext);
    }
View Full Code Here


   @Override
   public Object retrieveValue(String expression) throws UnsupportedOperationException
   {
      FacesContext facesContext = getFacesContext();
      ELContext elContext = facesContext.getELContext();
      return getValueExpression(facesContext, expression).getValue(elContext);
   }
View Full Code Here

   @Override
   public void submitValue(String expression, Object value) throws UnsupportedOperationException
   {
      FacesContext facesContext = getFacesContext();
      ELContext elContext = facesContext.getELContext();

      ValueExpression valueExpression = getValueExpression(facesContext, expression);
      Class<?> referencedType = valueExpression.getType(elContext);

      // the value that will be injected
View Full Code Here

   @Override
   public Object evaluateMethodExpression(String expression, Object... values) throws UnsupportedOperationException
   {
      String el = toELExpression(expression);
      FacesContext facesContext = getFacesContext();
      ELContext elContext = facesContext.getELContext();
      ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();
      MethodExpression methodExpression = expressionFactory.createMethodExpression(elContext, el,
               Object.class, new Class[values.length]);
      return methodExpression.invoke(elContext, values);
   }
View Full Code Here

    ELContext createELContext() {
        return createELContext(resolver, functionMapper.get(), variableMapper.get());
    }

    private ELContext createELContext(final ELResolver resolver, final FunctionMapper functionMapper, final VariableMapper variableMapper) {
        return new ELContext() {
            @Override
            public ELResolver getELResolver() {
                return resolver;
            }
View Full Code Here

            FacesContext context = getFacesContext();
            ValueExpression expression = treeNodeComponent
                    .getValueExpression(AbstractTreeNode.PropertyKeys.expanded.toString());
            if (expression != null) {
                ELContext elContext = context.getELContext();
                Exception caught = null;
                FacesMessage message = null;
                try {
                    expression.setValue(elContext, newExpandedValue);
                } catch (ELException e) {
View Full Code Here

    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();
View Full Code Here

        return genericPropertyClass;
    }

    public Class<?> getContainerClass(FacesContext facesContext, ValueExpression expression) {
        ELContext initialELContext = facesContext.getELContext();
        CapturingELResolver capturingELResolver = new CapturingELResolver(initialELContext.getELResolver());
        Class<?> type = expression.getType(new ELContextWrapper(initialELContext, capturingELResolver));
        Class<?> containerType = type.getComponentType();

        if ((containerType == null) && (type != null)) {
            if (Collection.class.isAssignableFrom(type)) {
View Full Code Here

        checkNull(componentExpression, "componentExpression");
        checkNull(facesContext, "facesContext");
        checkNull(componentType, "componentType");

        ELContext elContext = facesContext.getELContext();

        try
        {
            Object retVal = componentExpression.getValue(elContext);
View Full Code Here

    @SuppressWarnings("unchecked")
    @Override
    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

TOP

Related Classes of javax.el.ELContext

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.