Package juzu.impl.template.spi.juzu.compiler

Examples of juzu.impl.template.spi.juzu.compiler.EmitPhase


          0,
          0);
      processPhase.process(templateModel);

      // Emit
      EmitPhase emitPhase = new EmitPhase(new EmitContext(){
        @Override
        public TagHandler resolveTagHandler(String name) {
          if ("title".equals(name)) {
            return new TitleTag();
          } else {
            return null;
          }
        }

        public void createResource(Path.Absolute path, CharSequence content) throws IOException {
          throw new UnsupportedOperationException();
        }
      });
      emitPhase.emit(generator, templateModel.getModel());
    }
    catch (juzu.impl.template.spi.juzu.ast.ParseException e) {
      throw failure(e);
    }
    GroovyTemplateStub stub = generator.build(fqn.toString());
View Full Code Here


  }

  @Override
  public final void emit(EmitContext context, TemplateModel<ASTNode.Template> templateModel) throws TemplateException, IOException {
    GroovyTemplateEmitter emitter = new GroovyTemplateEmitter(templateModel.getPath().getName());
    EmitPhase tcc = new EmitPhase(context);
    tcc.emit(emitter, templateModel.getModel());
    Path.Absolute path = templateModel.getPath();
    path = path.as(path.getRawName() + "_", "groovy");
    context.createResource(path, emitter.toString());
  }
View Full Code Here

    });
    Path.Absolute template = process.resolveTemplate(Path.parse("index.gtmpl"));
    assertNotNull(template);

    // Now emit the template
    EmitPhase emit = new EmitPhase(new EmitContext(){
      public TagHandler resolveTagHandler(String name) {
        if ("decorate".equals(name)) {
          return new DecorateTag();
        } else {
          return null;
View Full Code Here

TOP

Related Classes of juzu.impl.template.spi.juzu.compiler.EmitPhase

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.