Package javax.el

Examples of javax.el.VariableMapper


        return result;
    }

    public void setValue(EvaluationContext ctx, Object value)
            throws ELException {
        VariableMapper varMapper = ctx.getVariableMapper();
        if (varMapper != null) {
            ValueExpression expr = varMapper.resolveVariable(this.image);
            if (expr != null) {
                expr.setValue(ctx.getELContext(), value);
                return;
            }
        }
View Full Code Here


            throws ELException {
        Object obj = null;

        // case A: ValueExpression exists, getValue which must
        // be a MethodExpression
        VariableMapper varMapper = ctx.getVariableMapper();
        ValueExpression ve = null;
        if (varMapper != null) {
            ve = varMapper.resolveVariable(this.image);
            if (ve != null) {
                obj = ve.getValue(ctx);
            }
        }
View Full Code Here

    public ExpressionBuilder(String expression, ELContext ctx)
            throws ELException {
        this.expression = expression;

        FunctionMapper ctxFn = ctx.getFunctionMapper();
        VariableMapper ctxVar = ctx.getVariableMapper();

        if (ctxFn != null) {
            this.fnMapper = new FunctionMapperFactory(ctxFn);
        }
        if (ctxVar != null) {
View Full Code Here

            // According to UserTagHandler, in this point we need to wrap the facelet
            // VariableMapper, so local changes are applied on "page context", but
            // data is retrieved from full context
            FaceletContext faceletContext = (FaceletContext) context.
                getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);
            VariableMapper orig = faceletContext.getVariableMapper();
            try
            {
                faceletContext.setVariableMapper(new VariableMapperWrapper(orig));
               
                compositeComponentBase.pushComponentToEL(context, compositeComponentBase);
View Full Code Here

                if (result instanceof ValueExpression) {
                    if (scope != PageContext.PAGE_SCOPE) {
                        throw new JspException(
                            Resources.getMessage("SET_BAD_SCOPE_DEFERRED"));
                    }
                    VariableMapper vm =
                        pageContext.getELContext().getVariableMapper();
                    if (vm != null) {
                        vm.setVariable(var, (ValueExpression)result);
                    }
                } else {
                    // Make sure to clear any previous mapping for this
                    // variable in the variable mapper.
                    if (scope ==  PageContext.PAGE_SCOPE) {
                        VariableMapper vm =
                            pageContext.getELContext().getVariableMapper();
                        if (vm != null) {
                            vm.setVariable(var, null);
                        }
                    }
                    pageContext.setAttribute(var, result, scope);
                }
      } else {
    if (scopeSpecified)
        pageContext.removeAttribute(var, scope);
    else
        pageContext.removeAttribute(var);

                if (scope == PageContext.PAGE_SCOPE) {
                    VariableMapper vm =
                        pageContext.getELContext().getVariableMapper();
                    if (vm != null) {
                        vm.setVariable(var, null);
                    }
                }
      }

  } else if (target != null) {
View Full Code Here

    private MethodExpression remap(FaceletContext faceletContext, String varName, Class<?> expectedReturnType,
        Class<?>[] expectedParamTypes) {

        MethodExpression result = null;

        VariableMapper mapper = faceletContext.getVariableMapper();
        ValueExpression valueExpression = mapper.resolveVariable(varName);
        if (valueExpression != null) {
            ExpressionFactory ef = faceletContext.getExpressionFactory();
            ELContext elContext = faceletContext.getFacesContext().getELContext();

            result = ef.createMethodExpression(elContext, valueExpression.getExpressionString(), expectedReturnType,
View Full Code Here

    public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException, ELException {

        MethodExpression actionExpression = remap(ctx, ACTION, String.class, ACTION_PARAM_TYPES);
        MethodExpression actionListenerExpression = remap(ctx, ACTION_LISTENER, null, ACTION_LISTENER_PARAM_TYPES);

        VariableMapper initialVarMapper = ctx.getVariableMapper();
        try {
            if (actionExpression == null) {
                actionExpression = NOOP_ACTION_EXPRESSION;
            }

            initialVarMapper.setVariable(MAPPED_ACTION,
                ctx.getExpressionFactory().createValueExpression(actionExpression, MethodExpression.class));

            if (actionListenerExpression == null) {
                actionListenerExpression = NOOP_ACTION_LISTENER_EXPRESSION;
            }

            initialVarMapper.setVariable(MAPPED_ACTION_LISTENER,
                ctx.getExpressionFactory().createValueExpression(actionListenerExpression, MethodExpression.class));

            ctx.setVariableMapper(initialVarMapper);

            nextHandler.apply(ctx, parent);
View Full Code Here

                mctx.addAttachedObjectHandler(
                        compositeComponentBase, it.next());
            }
        }   
       
        VariableMapper orig = faceletContext.getVariableMapper();
        try
        {
            faceletContext.setVariableMapper(new VariableMapperWrapper(orig));
            actx.pushCompositeComponentClient(this);
            Resource resourceForCurrentView = faceletContext.getFacesContext().getApplication().
View Full Code Here

            // According to UserTagHandler, in this point we need to wrap the facelet
            // VariableMapper, so local changes are applied on "page context", but
            // data is retrieved from full context
            FaceletContext faceletContext = (FaceletContext) context.
                    getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);
            VariableMapper orig = faceletContext.getVariableMapper();
            try
            {
                faceletContext.setVariableMapper(new VariableMapperWrapper(orig));

                compositeComponentBase.pushComponentToEL(context, compositeComponentBase);
View Full Code Here

                mctx.addAttachedObjectHandler(
                        compositeComponentBase, it.next());
            }
        }   
       
        VariableMapper orig = faceletContext.getVariableMapper();
        try
        {
            faceletContext.setVariableMapper(new VariableMapperWrapper(orig));
            actx.pushCompositeComponentClient(this);
            Resource resourceForCurrentView = faceletContext.getFacesContext().getApplication().
View Full Code Here

TOP

Related Classes of javax.el.VariableMapper

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.