Examples of VariableMapper


Examples of javax.el.VariableMapper

        return result;
    }

    @Override
    public Object getValue(EvaluationContext ctx) throws ELException {
        VariableMapper varMapper = ctx.getVariableMapper();
        if (varMapper != null) {
            ValueExpression expr = varMapper.resolveVariable(this.image);
            if (expr != null) {
                return expr.getValue(ctx.getELContext());
            }
        }
        ctx.setPropertyResolved(false);
View Full Code Here

Examples of javax.el.VariableMapper

        return result;
    }

    @Override
    public boolean isReadOnly(EvaluationContext ctx) throws ELException {
        VariableMapper varMapper = ctx.getVariableMapper();
        if (varMapper != null) {
            ValueExpression expr = varMapper.resolveVariable(this.image);
            if (expr != null) {
                return expr.isReadOnly(ctx.getELContext());
            }
        }
        ctx.setPropertyResolved(false);
View Full Code Here

Examples of javax.el.VariableMapper

    }

    @Override
    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

Examples of javax.el.VariableMapper

            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

Examples of javax.el.VariableMapper

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

Examples of javax.el.VariableMapper

                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

Examples of javax.el.VariableMapper

        return cont.getFunctionMapper();
      }

      @Override
      public VariableMapper getVariableMapper() {
        return new VariableMapper() {

          @Override
          public ValueExpression resolveVariable(String variable) {
            if (variable.equals(itemId)) {
              return new IndexedValueExpression(__value, index);
View Full Code Here

Examples of javax.el.VariableMapper

    // Set up var variable
    if (itemId != null) {
      if (index == null)
        pageContext.removeAttribute(itemId, PageContext.PAGE_SCOPE);
      else if (__value != null) {
        VariableMapper vm = pageContext.getELContext()
            .getVariableMapper();
        if (vm != null) {
          ValueExpression ve = getVarExpression(__value);
          vm.setVariable(itemId, ve);
        }
      } else
        pageContext.setAttribute(itemId, index);
    }

    // Set up index variable

    if (indexId != null) {
      if (index == null)
        pageContext.removeAttribute(indexId, PageContext.PAGE_SCOPE);
      else {
        IteratedIndexExpression indexExpression = new IteratedIndexExpression(
            index);
        VariableMapper vm = pageContext.getELContext()
            .getVariableMapper();
        if (vm != null) {
          vm.setVariable(indexId, indexExpression);
        }
      }
    }

  }
View Full Code Here

Examples of javax.el.VariableMapper

     * Sets page request variables
     *
     * @param ctx
     */
    private void exposeVariables(FaceletContext ctx) {
        VariableMapper vm = ctx.getVariableMapper();
        if (vm == null) {
            return;
        }

        ColumnsHandlerIterationContext itContext = getIterationContext();
        if (itContext.getItemId() != null) {
            if (value != null) {
                ValueExpression srcVE = value.getValueExpression(ctx, Object.class);
                ValueExpression ve = itContext.getVarExpression(ctx, srcVE);
                vm.setVariable(itContext.getItemId(), ve);
            }
        }

        // Set up index variable
        if (itContext.getIndexId() != null) {
            ValueExpression ve = new IteratedIndexExpression(itContext.getIndex());
            vm.setVariable(itContext.getIndexId(), ve);
        }

        int componentsCount = itContext.getIndex() - itContext.getBegin();
        if (componentsCount != 0) {
            ValueExpression ve = ctx.getExpressionFactory().createValueExpression(
                UIViewRoot.UNIQUE_ID_PREFIX + componentsCount, String.class);
           
            vm.setVariable(ITERATION_INDEX_VARIABLE, ve);
        }
    }
View Full Code Here

Examples of javax.el.VariableMapper

     * them to their prior values (and scopes).
     *
     * @param ctx
     */
    private void unExposeVariables(FaceletContext ctx) {
        VariableMapper vm = ctx.getVariableMapper();
        if (vm == null) {
            return;
        }

        // "nested" variables are now simply removed
        ColumnsHandlerIterationContext itContext = getIterationContext();
        if (itContext.getItemId() != null) {
            vm.setVariable(itContext.getItemId(), null);
        }
        if (itContext.getIndexId() != null) {
            vm.setVariable(itContext.getIndexId(), null);
        }

        vm.setVariable(ITERATION_INDEX_VARIABLE, null);
    }
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.