Package javax.faces.view.facelets

Examples of javax.faces.view.facelets.FaceletHandler


        // The alias is used later for informative purposes, so we append
        // some prefix to identify later where the errors comes from.
        String alias = "/viewMetadata/" + url.getFile().replaceFirst(_baseUrl.getFile(), "");
        try
        {
            FaceletHandler h = _compiler.compileViewMetadata(url, alias);
            DefaultFacelet f = new DefaultFacelet(this, _compiler.createExpressionFactory(), url, alias, h);
            return f;
        }
        catch (FileNotFoundException fnfe)
        {
View Full Code Here


        // The alias is used later for informative purposes, so we append
        // some prefix to identify later where the errors comes from.
        String alias = "/compositeComponentMetadata/" + url.getFile().replaceFirst(_baseUrl.getFile(), "");
        try
        {
            FaceletHandler h = _compiler.compileCompositeComponentMetadata(url, alias);
            DefaultFacelet f = new DefaultFacelet(this, _compiler.createExpressionFactory(), url, alias, h, true);
            return f;
        }
        catch (FileNotFoundException fnfe)
        {
View Full Code Here

    public NamespaceUnit(TagLibrary library) {
        this.library = library;
    }

    public FaceletHandler createFaceletHandler() {
        FaceletHandler next = this.getNextFaceletHandler();
        return new NamespaceHandler(next, this.library, this.ns);
    }
View Full Code Here

            log.fine("Creating Facelet for: " + url);
        }
        String alias = '/'
                       + url.getFile().replaceFirst(this.baseUrl.getFile(), "");
        try {
            FaceletHandler h = this.compiler.compile(url, alias);
            return new DefaultFacelet(this,
                                      this.compiler.createExpressionFactory(),
                                      url,
                                      alias,
                                      h);
View Full Code Here

            log.fine("Creating Metadata Facelet for: " + url);
        }
        String alias = '/'
                       + url.getFile().replaceFirst(this.baseUrl.getFile(), "");
        try {
            FaceletHandler h = this.compiler.metadataCompile(url, alias);
            return new DefaultFacelet(this,
                                      this.compiler.createExpressionFactory(),
                                      url,
                                      alias,
                                      h);
View Full Code Here

    verify(this.decoratedComponent2).apply(this.ctx, this.parent, TEMPLATE);
  }

  @Test
  public void shouldPreserveUnknown() throws Exception {
    FaceletHandler unknown1 = mockFaceletHandler("unknown1", Type.OTHER);
    FaceletHandler unknown2 = mockFaceletHandler("unknown2", Type.OTHER);
    CompositeFaceletHandler nextHandler = new CompositeFaceletHandler(new FaceletHandler[] { unknown1,
        this.component1, unknown2 });
    given(this.tagConfig.getNextHandler()).willReturn(nextHandler);
    createDecorateAllHandlerAndApply();
    InOrder inOrder = inOrder(unknown1, this.decoratedComponent1, unknown2);
View Full Code Here

    assertThat(this.variableDeclarationHandlers1.getValue().size(), is(0));
  }

  @Test
  public void shouldPassDefinedParameters() throws Exception {
    FaceletHandler global1 = mockFaceletHandler("global1", Type.VARIABLE_DECLARATION);
    FaceletHandler global2 = mockFaceletHandler("global2", Type.VARIABLE_DECLARATION);
    FaceletHandler local1 = mockFaceletHandler("local1", Type.VARIABLE_DECLARATION);
    FaceletHandler local2 = mockFaceletHandler("local2", Type.VARIABLE_DECLARATION);
    FaceletHandler local3 = mockFaceletHandler("local3", Type.VARIABLE_DECLARATION);
    FaceletHandler nextHandler = new CompositeFaceletHandler(new FaceletHandler[] { global1, global2,
        this.component1, local1, local2, this.component2, local3 });
    given(this.tagConfig.getNextHandler()).willReturn(nextHandler);
    createDecorateAllHandlerAndApply();
    assertThat(this.variableDeclarationHandlers1.getValue(),
        is(equalTo(Arrays.asList(global1, global2, local1, local2))));
View Full Code Here

    this.decorateAllHandler = new MockedDecorateAllHandler(this.tagConfig);
    this.decorateAllHandler.apply(this.ctx, this.parent);
  }

  private FaceletHandler mockFaceletHandler(String name, Type type) {
    FaceletHandler handler = mock(FaceletHandler.class, name);
    given(this.delegate.getType(handler)).willReturn(type);
    return handler;
  }
View Full Code Here

    assertThat(this.delegate.getType(mock(FaceletHandler.class)), is(DecorateAllHandler.Type.OTHER));
  }

  @Test
  public void shouldApply() throws Exception {
    FaceletHandler handler = mock(ComponentHandler.class);
    List<FaceletHandler> variableDeclarationHandlers = new ArrayList<FaceletHandler>();
    DecoratedChild decorated = this.delegate.createdDecoratedChild(handler, variableDeclarationHandlers);
    decorated.apply(this.ctx, this.parent, "template");
    verify(this.ctx).pushClient(this.templateClient.capture());
    verify(this.ctx).includeFacelet(this.parent, "template");
View Full Code Here

    verify(this.ctx).popClient(this.templateClient.getValue());
  }

  @Test
  public void shouldApplyDefine() throws Exception {
    FaceletHandler handler = mock(ComponentHandler.class);
    List<FaceletHandler> variableDeclarationHandlers = new ArrayList<FaceletHandler>();
    variableDeclarationHandlers.add(mockDefineHandler());
    DecoratedChild decorated = this.delegate.createdDecoratedChild(handler, variableDeclarationHandlers);
    decorated.apply(this.ctx, this.parent, "template");
    verify(this.ctx).pushClient(this.templateClient.capture());
View Full Code Here

TOP

Related Classes of javax.faces.view.facelets.FaceletHandler

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.