Examples of MethodExpression


Examples of javax.el.MethodExpression

            // 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

Examples of javax.el.MethodExpression

    /**
     * @deprecated Use getActionExpression() instead.
     */
    public MethodBinding getAction()
    {
        MethodExpression actionExpression = getActionExpression();
        if (actionExpression instanceof MethodBindingToMethodExpression) {
            return ((MethodBindingToMethodExpression)actionExpression).getMethodBinding();
        }
        if(actionExpression != null)
        {
View Full Code Here

Examples of javax.el.MethodExpression

     *  
     * @return the method binding to the mouse listener method
     */
    public MethodBinding getMouseListener()
    {
        MethodExpression mouseListenerExpression = getMouseListenerExpression();
        if (mouseListenerExpression instanceof MethodBindingToMethodExpression) {
            return ((MethodBindingToMethodExpression)mouseListenerExpression).getMethodBinding();
        }
        if(mouseListenerExpression != null)
        {
View Full Code Here

Examples of javax.el.MethodExpression

          // truncated in Firefox.
          hsr.setHeader("Content-Disposition",
                        "attachment; filename=\""+encodeHTTPHeaderFilename + "\"");

        }
        MethodExpression method = getMethod();
        OutputStream out = new BufferedOutputStream(new OnDemandOutputStream(hsr));
        try
        {
          method.invoke(context.getELContext(), new Object[]{context, out});
        }
        catch (Exception e)
        {
          FacesMessage error = MessageFactory.getMessage(e);
          context.addMessage(null, error);
View Full Code Here

Examples of javax.el.MethodExpression

   
    @Override
    @SuppressWarnings("deprecation")
    public void applyMetadata(FaceletContext ctx, Object instance)
    {
      MethodExpression expr =
        _attribute.getMethodExpression(ctx, null, _paramList);
     
      try
      {
        _method.invoke(instance,
View Full Code Here

Examples of javax.el.MethodExpression

            {
                ctx.getFacesContext().getExternalContext().getRequestMap().put("facelets.Encoding", encodingValue);
            }
            if (this.beforePhase != null)
            {
                MethodExpression m = this.beforePhase.getMethodExpression(ctx, null, LISTENER_SIG);
                root.setBeforePhaseListener(m);
            }
            if (this.afterPhase != null)
            {
                MethodExpression m = this.afterPhase.getMethodExpression(ctx, null, LISTENER_SIG);
                root.setAfterPhaseListener(m);
            }
        }
        this.nextHandler.apply(ctx, parent);
    }
View Full Code Here

Examples of javax.el.MethodExpression

    {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        Application application = facesContext.getApplication();
        UIComponent component = actionEvent.getComponent();
       
        MethodExpression methodExpression = null;
        MethodBinding methodBinding = null;
       
        String fromAction = null;
        String outcome = null;
       
        if (component instanceof ActionSource2)
        {
            // Must be an instance of ActionSource2, so don't look on action if the actionExpression is set
            methodExpression = ((ActionSource2) component).getActionExpression();           
        }
        if (methodExpression == null && component instanceof ActionSource)
        {
            // Backwards compatibility for pre-1.2.
            methodBinding = ((ActionSource) component).getAction();
        }
       
        if (methodExpression != null)
        {
            fromAction = methodExpression.getExpressionString();
            try
            {
                Object objOutcome = methodExpression.invoke(facesContext.getELContext(), null);
                if (objOutcome != null)
                {
                    outcome = objOutcome.toString();
                }
            }
View Full Code Here

Examples of javax.el.MethodExpression

                            }
                        }
                    }
                    else
                    {
                        MethodExpression methodExpression = null;
                        // composite:attribute targets property only has sense for action, actionListener,
                        // validator or valueChangeListener. This means we have to retarget the method expression
                        // to the topLevelComponent.

                        // Since a MethodExpression has no state, we can use it multiple times without problem, so
View Full Code Here

Examples of javax.el.MethodExpression

                                               String attributeExpressionString,
                                               ValueExpression attributeNameValueExpression,
                                               boolean ccAttrMeRedirection)
    {
        // target is ActionSource2
        MethodExpression methodExpression = reWrapMethodExpression(context.getApplication().getExpressionFactory().
                createMethodExpression(elContext,
                        attributeExpressionString, null,
                        EMPTY_CLASS_ARRAY), attributeNameValueExpression);

        //Store the method expression to the topLevelComponent to allow reference it through EL
View Full Code Here

Examples of javax.el.MethodExpression

                                                       String attributeExpressionString,
                                                       ValueExpression attributeNameValueExpression,
                                                       boolean ccAttrMeRedirection)
    {
        // target is ActionSource2
        MethodExpression methodExpression = reWrapMethodExpression(context.getApplication().getExpressionFactory().
                createMethodExpression(elContext,
                        attributeExpressionString, Void.TYPE, ACTION_LISTENER_SIGNATURE),
                        attributeNameValueExpression);

        MethodExpression methodExpression2 = reWrapMethodExpression(context.getApplication().getExpressionFactory().
                createMethodExpression(elContext,
                        attributeExpressionString, Void.TYPE, EMPTY_CLASS_ARRAY),
                        attributeNameValueExpression);

        //Store the method expression to the topLevelComponent to allow reference it through EL
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.