Package javax.el

Examples of javax.el.ExpressionFactory.createValueExpression()


                    }
                }, null),
                new FilterField(expressionFactory.createValueExpression(elContext, "#{var.lname != filterVar}", Object.class),
                    null, "b") };
        SortField[] sortFields = {
                new SortField(expressionFactory.createValueExpression(elContext, "#{var.fname}", Object.class), null,
                    SortOrder.ascending), new SortField(null, new Comparator<User>() {
                    public int compare(User o1, User o2) {
                        return o1.getLname().compareTo(o2.getLname());
                    }
                }, SortOrder.descending) };
View Full Code Here


   public static final Pattern elPattern = Pattern.compile(EL_REGEX);

   public Object coerceToType(final FacesContext context, final String expression, final Object value) throws ELException
   {
      ExpressionFactory ef = context.getApplication().getExpressionFactory();
      ValueExpression ve = ef.createValueExpression(context.getELContext(), expression, Object.class);
      return ef.coerceToType(value, ve.getType(context.getELContext()));
   }

   public Class<?> getExpectedType(final FacesContext context, final String expression) throws ELException
   {
View Full Code Here

   }

   public Class<?> getExpectedType(final FacesContext context, final String expression) throws ELException
   {
      ExpressionFactory ef = context.getApplication().getExpressionFactory();
      ValueExpression ve = ef.createValueExpression(context.getELContext(), expression, Object.class);
      return ve.getType(context.getELContext());
   }

   public Object getValue(final FacesContext context, final String expression) throws ELException
   {
View Full Code Here

   }

   public Object getValue(final FacesContext context, final String expression) throws ELException
   {
      ExpressionFactory ef = context.getApplication().getExpressionFactory();
      ValueExpression ve = ef.createValueExpression(context.getELContext(), expression, Object.class);
      return ve.getValue(context.getELContext());
   }

   public Object invokeMethod(final FacesContext context, final String expression) throws ELException
   {
View Full Code Here

   }

   public void setValue(final FacesContext context, final String expression, final Object value) throws ELException
   {
      ExpressionFactory ef = context.getApplication().getExpressionFactory();
      ValueExpression ve = ef.createValueExpression(context.getELContext(), expression, Object.class);
      ve.setValue(context.getELContext(), ef.coerceToType(value, ve.getType(context.getELContext())));
   }

   public ValueExpression createValueExpression(final FacesContext context, final String expression) throws ELException
   {
View Full Code Here

   }

   public ValueExpression createValueExpression(final FacesContext context, final String expression) throws ELException
   {
      ExpressionFactory ef = context.getApplication().getExpressionFactory();
      ValueExpression ve = ef.createValueExpression(context.getELContext(), expression, Object.class);
      return ve;
   }
}
View Full Code Here

    */
   private ValueExpression getValueExpression(FacesContext facesContext, String expression)
   {
      String el = toELExpression(expression);
      ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();
      return expressionFactory.createValueExpression(facesContext.getELContext(), el, Object.class);
   }

   /**
    * Obtains the {@link FacesContext} using {@link FacesContext#getCurrentInstance()}. This method will throw an
    * {@link IllegalArgumentException} if the {@link FacesContext} is not available.
View Full Code Here

         {
            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

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

            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

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.