Package javax.el

Examples of javax.el.MethodExpression


  public void broadcast(javax.faces.event.FacesEvent event) throws javax.faces.event.AbortProcessingException {
    super.broadcast(event);
   
    FacesContext facesContext = FacesContext.getCurrentInstance();
    MethodExpression me = getSelectListener();
   
    if (me != null && event instanceof org.primefaces.event.SelectEvent) {
      me.invoke(facesContext.getELContext(), new Object[] {event});
    }
  }
View Full Code Here


    super.broadcast(event);
   
    FacesContext facesContext = FacesContext.getCurrentInstance();
   
    if(event instanceof org.primefaces.event.CloseEvent) {
      MethodExpression closeMe = getCloseListener();
     
      if(closeMe != null) {
        closeMe.invoke(facesContext.getELContext(), new Object[] {event});
      }
    } else if(event instanceof org.primefaces.event.ToggleEvent) {
      MethodExpression toggleMe = getToggleListener();
     
      if(toggleMe != null) {
        toggleMe.invoke(facesContext.getELContext(), new Object[] {event});
      }
    } else if(event instanceof org.primefaces.event.ResizeEvent) {
      MethodExpression resizeMe = getResizeListener();
     
      if(resizeMe != null) {
        resizeMe.invoke(facesContext.getELContext(), new Object[] {event});
      }
    }
  }
View Full Code Here

        }

        if (params == null)
            params = new Class[0];

        MethodExpression methodExpression;

        try
        {
            methodExpression = getExpressionFactory().createMethodExpression(threadELContext(), reference,
                                                                             Object.class, params);
View Full Code Here

                    }
                }
               
                String [] targetsArray = StringUtils.splitShortString(targets, ' ');
                String attributeExpressionString = attributeNameValueExpression.getExpressionString();
                MethodExpression methodExpression = null;
               
                // if the expression String contains a reference to the current composite
                // component #{cc}, the MethodExpression has to be invoked indirectly (via
                // a ValueExpression that points to the real MethodExpression). This happens
                // when other composite components are nested in composite components' implementations.
View Full Code Here

                        .getValueExpression(faceletContext, Boolean.class));
            }
        }
        if (_listener != null)
        {
            MethodExpression expr = _listener.getMethodExpression(
                    faceletContext, Void.TYPE, AJAX_BEHAVIOR_LISTENER_SIG);
            AjaxBehaviorListener abl = new AjaxBehaviorListenerImpl(expr);
            ajaxBehavior.addAjaxBehaviorListener(abl);
        }
        if (_onerror != null)
View Full Code Here

       
        Class<? extends ComponentSystemEvent> eventClass = getEventClass(ctx);
       
        // Note: The listener attribute can now also take a zero-argument MethodExpression,
        // thus we need two different MethodExpressions (see MYFACES-2503 for details).
        MethodExpression methodExpOneArg
                = listener.getMethodExpression(ctx, void.class, COMPONENT_SYSTEM_EVENT_PARAMETER);
        MethodExpression methodExpZeroArg
                = listener.getMethodExpression(ctx, void.class, EMPTY_CLASS_ARRAY);
       
        if (eventClass == PreRenderViewEvent.class)
        {
            // ensure ViewRoot for PreRenderViewEvent
View Full Code Here

     */
    public MethodExpression getMethodExpression(FaceletContext ctx, Class type, Class[] paramTypes)
    {
        try
        {
            MethodExpression methodExpression = null;
           
            // From this point we can suppose this attribute contains a ELExpression
            // Now we have to check if the expression points to a composite component attribute map
            // and if so deal with it as an indirection.
            if (isCompositeComponentAttributeMapExpression())
View Full Code Here

            this._attr = attr;
        }

        public void applyMetadata(FaceletContext ctx, Object instance)
        {
            MethodExpression expr = _attr.getMethodExpression(ctx, String.class, ActionSourceRule.ACTION_SIG);
            ((ActionSource2) instance).setActionExpression(expr);
        }
View Full Code Here

            // It seems that MethodExpressionActionListener from API contains support for it but there is one big
            // problem - one-arg constructor will not preserve the current VariableMapper.
            // This is a problem when using facelets and <ui:decorate/> with EL params (see MYFACES-2541 for details).
            // So we must create two MethodExpressions here - both are created from the current
            // facelets context and thus varibale mapping will work.
            final MethodExpression methodExpressionOneArg = _attr.getMethodExpression(ctx, null, ActionSourceRule.ACTION_LISTENER_SIG);
            final MethodExpression methodExpressionZeroArg = _attr.getMethodExpression(ctx, null, ActionSourceRule.ACTION_SIG);
            if (((AbstractFaceletContext)ctx).isUsingPSSOnThisView())
            {
                ((ActionSource2) instance).addActionListener(
                        new PartialMethodExpressionActionListener(methodExpressionOneArg, methodExpressionZeroArg));
            }
View Full Code Here

            // It seems that MethodExpressionValueChangeListener from API contains support for it but there is one big
            // problem - one-arg constructor will not preserve the current VariableMapper.
            // This is a problem when using facelets and <ui:decorate/> with EL params (see MYFACES-2541 for details).
            // So we must create two MethodExpressions here - both are created from the current
            // facelets context and thus variable mapping will work.
            final MethodExpression methodExpressionOneArg = attr.getMethodExpression(ctx, null, VALUECHANGE_SIG);
            final MethodExpression methodExpressionZeroArg = attr.getMethodExpression(ctx, null, EMPTY_CLASS_ARRAY);
            if (((AbstractFaceletContext)ctx).isUsingPSSOnThisView())
            {
                ((EditableValueHolder) instance).addValueChangeListener(
                        new PartialMethodExpressionValueChangeListener(methodExpressionOneArg, methodExpressionZeroArg));
            }
View Full Code Here

TOP

Related Classes of javax.el.MethodExpression

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.