Examples of VariableMapper


Examples of javax.el.VariableMapper

     *
     * @throws JspTagException
     */
    private void exposeVariables(FaceletContext ctx, int k) {

  VariableMapper vm = ctx.getVariableMapper();

  if (_itemId != null) {
      if (vm != null) {
    if (value != null) {
        ValueExpression srcVE = value.getValueExpression(ctx,
          Object.class);
        ValueExpression ve = getVarExpression(ctx, srcVE, k);
        vm.setVariable(_itemId, ve);
    }
      }

  }

  // Set up index variable

  if (_indexId != null) {
      if (vm != null) {
    ValueExpression ve = new IteratedIndexExpression(k);
    vm.setVariable(_indexId, ve);
      }

  }

    }
View Full Code Here

Examples of javax.el.VariableMapper

    /**
     * Removes page attributes that we have exposed and, if applicable, restores
     * them to their prior values (and scopes).
     */
    private void unExposeVariables(FaceletContext ctx) {
  VariableMapper vm = ctx.getVariableMapper();
  // "nested" variables are now simply removed
  if (_itemId != null) {
      if (vm != null)
    vm.setVariable(_itemId, null);
  }
  if (_indexId != null) {
      if (vm != null)
    vm.setVariable(_indexId, null);
  }
    }
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 - begin);
        VariableMapper vm = pageContext.getELContext()
            .getVariableMapper();
        if (vm != null) {
          vm.setVariable(indexId, indexExpression);
        }
      }
    }

  }
View Full Code Here

Examples of javax.el.VariableMapper

        CompositeComponentBeanInfo result;
        FaceletContext ctx = (FaceletContext)
                context.getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);
        FaceletFactory factory = (FaceletFactory)
              RequestStateManager.get(context, RequestStateManager.FACELET_FACTORY);
        VariableMapper orig = ctx.getVariableMapper();

    // create tmp and facetComponent
        UIComponent tmp = context.getApplication().createComponent("javax.faces.NamingContainer");
        UIPanel facetComponent = (UIPanel)
                context.getApplication().createComponent("javax.faces.Panel");

    // PENDING I think this can be skipped because we don't render
    // this component instance.
        facetComponent.setRendererType("javax.faces.Group");

    // PENDING This could possibly be skipped too.  However, I think
    // this is important because other tag handlers, within
    // <cc:interface> expect it will be there.
        tmp.getFacets().put(UIComponent.COMPOSITE_FACET_NAME, facetComponent);
        // We have to put the resource in here just so the classes that eventually
        // get called by facelets have access to it.
        tmp.getAttributes().put(Resource.COMPONENT_RESOURCE_KEY,
                ccResource);
       
        Facelet f;

        try {
            f = factory.getFacelet(ccResource.getURL());
            VariableMapper wrapper = new VariableMapperWrapper(orig) {

                @Override
                public ValueExpression resolveVariable(String variable) {
                    return super.resolveVariable(variable);
                }
View Full Code Here

Examples of javax.el.VariableMapper

    throws IOException {

        FacesContext facesContext = ctx.getFacesContext();
        FaceletFactory factory = (FaceletFactory)
              RequestStateManager.get(facesContext, RequestStateManager.FACELET_FACTORY);
        VariableMapper orig = ctx.getVariableMapper();
       
        UIPanel facetComponent;
        if (ComponentHandler.isNew(c)) {
            facetComponent = (UIPanel)
            facesContext.getApplication().createComponent("javax.faces.Panel");
            facetComponent.setRendererType("javax.faces.Group");
            c.getFacets().put(UIComponent.COMPOSITE_FACET_NAME, facetComponent);
        }                                                                                
        else {
            facetComponent = (UIPanel)
                    c.getFacets().get(UIComponent.COMPOSITE_FACET_NAME);
        }
        assert(null != facetComponent);
       
        try {
            Facelet f = factory.getFacelet(ccResource.getURL());

            VariableMapper wrapper = new VariableMapperWrapper(orig) {

                @Override
                public ValueExpression resolveVariable(String variable) {
                    return super.resolveVariable(variable);
                }
View Full Code Here

Examples of javax.el.VariableMapper

            throws IOException {
        String path = this.src.getValue(ctx);
        if (path == null || path.length() == 0) {
            return;
        }
        VariableMapper orig = ctx.getVariableMapper();
        ctx.setVariableMapper(new VariableMapperWrapper(orig));
        try {
            this.nextHandler.apply(ctx, null);
            ctx.includeFacelet(parent, path);
        } catch (IOException e) {
View Full Code Here

Examples of javax.el.VariableMapper

            throw new TagException(tag, "Process has a null fileDefinition property");
        }
        if (! fileDefinition.hasFile(file)) {
            throw new TagException(tag, "Process does not contain file '" + file + "'");
        }
        VariableMapper orig = ctx.getVariableMapper();
        final VariableMapperWrapper newVarMapper = new VariableMapperWrapper(orig);
        ctx.setVariableMapper(newVarMapper);
        try {
            final StringBuffer buffer = new StringBuffer();
            buffer.append(processDefinition.getId());
View Full Code Here

Examples of javax.el.VariableMapper

     * @see com.sun.facelets.FaceletHandler#apply(com.sun.facelets.FaceletContext,
     *      javax.faces.component.UIComponent)
     */
    public void apply(FaceletContext ctx, UIComponent parent)
            throws IOException, FacesException, FaceletException, ELException {
        VariableMapper orig = ctx.getVariableMapper();
        if (this.params != null) {
            VariableMapper vm = new VariableMapperWrapper(orig);
            ctx.setVariableMapper(vm);
            for (int i = 0; i < this.params.length; i++) {
                this.params[i].apply(ctx, parent);
            }
        }
View Full Code Here

Examples of javax.el.VariableMapper

     *      javax.faces.component.UIComponent)
     */
    public void apply(FaceletContext ctx, UIComponent parent)
            throws IOException, FacesException, FaceletException, ELException {
        if (this.template != null) {
            VariableMapper orig = ctx.getVariableMapper();
            if (this.params != null) {
                VariableMapper vm = new VariableMapperWrapper(orig);
                ctx.setVariableMapper(vm);
                for (int i = 0; i < this.params.length; i++) {
                    this.params[i].apply(ctx, parent);
                }
            }
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.