Package javax.faces.view.facelets

Examples of javax.faces.view.facelets.FaceletHandler


    verify(this.innerDefineHandler).apply(this.ctx, this.parent);
  }

  @Test
  public void shouldApplyParameters() throws Exception {
    FaceletHandler handler = mock(ComponentHandler.class);
    List<FaceletHandler> variableDeclarationHandlers = new ArrayList<FaceletHandler>();
    FaceletHandler paramHandler = mock(ParamHandler.class);
    variableDeclarationHandlers.add(paramHandler);
    VariableMapper originalVariableMapper = mock(VariableMapper.class);
    given(this.ctx.getVariableMapper()).willReturn(originalVariableMapper);
    DecoratedChild decorated = this.delegate.createdDecoratedChild(handler, variableDeclarationHandlers);
    decorated.apply(this.ctx, this.parent, null);
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

    verify(this.innerDefineHandler).apply(this.ctx, this.parent);
  }

  @Test
  public void shouldApplyParameters() throws Exception {
    FaceletHandler handler = mock(ComponentHandler.class);
    List<FaceletHandler> variableDeclarationHandlers = new ArrayList<FaceletHandler>();
    FaceletHandler paramHandler = mock(ParamHandler.class);
    variableDeclarationHandlers.add(paramHandler);
    VariableMapper originalVariableMapper = mock(VariableMapper.class);
    given(this.ctx.getVariableMapper()).willReturn(originalVariableMapper);
    DecoratedChild decorated = this.delegate.createdDecoratedChild(handler, variableDeclarationHandlers);
    decorated.apply(this.ctx, this.parent, null);
View Full Code Here

    Delegate delegate = getDelegate();
    this.template = this.getRequiredAttribute("template");
    this.children = new ArrayList<Object>();
    List<FaceletHandler> globalVariableDeclarations = new ArrayList<FaceletHandler>();
    List<FaceletHandler> variableDeclarations = new ArrayList<FaceletHandler>();
    FaceletHandler component = null;
    for (FaceletHandler child : getHandlers(this.nextHandler)) {
      Type type = delegate.getType(child);
      if (type == Type.VARIABLE_DECLARATION) {
        if (component == null) {
          globalVariableDeclarations.add(child);
View Full Code Here

            log.fine("Creating Facelet for: " + url);
        }
        String escapedBaseURL = Pattern.quote(this.baseUrl.getFile());
        String alias = '/' + url.getFile().replaceFirst(escapedBaseURL, "");
        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 escapedBaseURL = Pattern.quote(this.baseUrl.getFile());
        String alias = '/' + url.getFile().replaceFirst(escapedBaseURL, "");
        try {
            FaceletHandler h = this.compiler.metadataCompile(url, alias);
            return new DefaultFacelet(this,
                                      this.compiler.createExpressionFactory(),
                                      url,
                                      alias,
                                      h);
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 escapedBaseURL = Pattern.quote(this.baseUrl.getFile());
        String alias = '/' + url.getFile().replaceFirst(escapedBaseURL, "");
        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 escapedBaseURL = Pattern.quote(this.baseUrl.getFile());
        String alias = '/' + url.getFile().replaceFirst(escapedBaseURL, "");
        try {
            FaceletHandler h = this.compiler.metadataCompile(url, alias);
            return new DefaultFacelet(this,
                                      this.compiler.createExpressionFactory(),
                                      url,
                                      alias,
                                      h);
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.