Package javax.el

Examples of javax.el.MethodExpression.invoke()


        SubmittedValue valueHolder = (SubmittedValue) getSubmitedValue();
        Object submittedValue = valueHolder != null ? valueHolder.getSuggestionValue() : null;
       
    MethodExpression suggestingAction = getSuggestionAction();
    if (null != suggestingAction) {
        setValue(suggestingAction.invoke(
                context.getELContext(), new Object[]{submittedValue}));
    }
  }

  public void addAjaxListener(final AjaxListener listener) {
View Full Code Here


        ExpressionFactory wrappedExpressionFactory = getCurrentManager().wrapExpressionFactory(new DummyExpressionFactory());

        // Create method expression and invoke it with supplied EL context (porting package)
        MethodExpression methodExpression = wrappedExpressionFactory.createMethodExpression(null, "foo.test", String.class,
                null);
        Object methodElResult = methodExpression.invoke(getCurrentConfiguration().getEl().createELContext(getCurrentManager()),
                null);
        assertNotNull(methodElResult);
        assertTrue(methodElResult instanceof Integer);
        assertEquals(methodElResult, Integer.valueOf(-1));
View Full Code Here

      result = parent.invoke(context, params);
    } catch (MethodNotFoundException e) {
      Object base = baseObjectExpression.getValue(context);
      if (base instanceof MethodExpression) {
        MethodExpression referencedMethod = (MethodExpression) base;
        result = referencedMethod.invoke(context, params);
      } else {
        throw e;
      }
    }
    return result;
View Full Code Here

          if (!submittedCurrentDate.equals(currentDate)) {
            updateCurrentDate(facesContext, submittedCurrentDate);
            MethodExpression methodExpression = getCurrentDateChangeListener();
            if (methodExpression != null) {
                methodExpression.invoke(facesContext.getELContext(), new Object[] { dateChangeEvent });
            }
          }
         
        } catch (Exception e) {
          // XXX nick - kaa - add log.debug(...)
View Full Code Here

      FacesContext context = getFacesContext();

      MethodExpression scrollerListener = getScrollerListener();
      if (scrollerListener != null) {
        scrollerListener.invoke(context.getELContext(), new Object[]{event});
      }
    } else if (event instanceof AjaxEvent) {
      FacesContext context = getFacesContext();

      AjaxRendererUtils.addRegionByName(context, this, this.getId());
View Full Code Here

       
        ActionSource2 as2 = (ActionSource2) c;
        MethodExpression me = as2.getActionExpression();
        assertNotNull("method", me);
       
        String result = (String) me.invoke(faces.getELContext(), null);
        System.out.println(result);
    }
   
    public void testCommandButton() throws Exception {
        FacesContext faces = FacesContext.getCurrentInstance();
View Full Code Here

              (!isBefore && (null != afterPhase));
        MethodExpression expression = isBefore ? beforePhase : afterPhase;

        if (hasPhaseMethodExpression) {
            try {
                expression.invoke(context.getELContext(), new Object[]{event});
                skipPhase = context.getResponseComplete() ||
                            context.getRenderResponse();
            }
            catch (Exception e) {
                // PENDING(edburns): log this
View Full Code Here

              (!isBefore && (null != afterPhase) && !beforeMethodException);
        MethodExpression expression = isBefore ? beforePhase : afterPhase;

        if (hasPhaseMethodExpression) {
            try {
                expression.invoke(context.getELContext(), new Object[]{event});
                skipPhase = context.getResponseComplete() ||
                            context.getRenderResponse();
            }
            catch (Exception e) {
                if (isBefore) {
View Full Code Here

                        for (Parameter cur : paramList) {
                            params[i++] = cur.getValue().getValue(elContext);
                        }
                    }
                   
                    Object invokeResult = me.invoke(context.getELContext(), params);
                    if (null == invokeResult) {
                        ValueExpression ve = methodCallNode.getOutcome();
                        if (null != ve) {
                            invokeResult  = ve.getValue(context.getELContext());
                        }
View Full Code Here

    private final Object invokeTarget(EvaluationContext ctx, Object target,
            Object[] paramValues) throws ELException {
        if (target instanceof MethodExpression) {
            MethodExpression me = (MethodExpression) target;
            return me.invoke(ctx.getELContext(), paramValues);
        } else if (target == null) {
            throw new MethodNotFoundException("Identity '" + this.image
                    + "' was null and was unable to invoke");
        } else {
            throw new ELException(
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.