Package org.xulfaces.annotation.processor

Examples of org.xulfaces.annotation.processor.VelocityTemplateEngine


        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
   
    VelocityTemplateEngine engine = new VelocityTemplateEngine();
    try {
      String filename = path + "/xulfaces-config.xml";
      log.debug("Output file is " + filename + ".");
      BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(filename));
      log.debug("Output file created.");
      engine.configure();
      engine.prepareRender();
      engine.setContextValue("facesConfig", this.facesConfig);
      engine.renderTemplate(bufferedWriter, "faces-config.vm");
      bufferedWriter.flush();
      bufferedWriter.close();     
    } catch (Exception e1) {
      throw new RuntimeException(e1);
    }
View Full Code Here


        component.getAttributes().add(attribute)
      }
    }
     
    StringWriter stringWriter = new StringWriter();
    VelocityTemplateEngine engine = new VelocityTemplateEngine();
    try {
      engine.configure();   
      engine.prepareRender();                   
      engine.setContextValue("component",component);
      engine.renderTemplate(stringWriter,"component.vm");
      this.facesConfig.components.put(currentClass.getName(),stringWriter.toString());
    } catch (Exception e1) {
      throw new RuntimeException(e1);
    }         
  }
View Full Code Here

  }

  private String processRendererAnnotation(RENDERER rendererAnnotation, Class currentClass) {

    StringWriter stringWriter = new StringWriter();
    VelocityTemplateEngine engine = new VelocityTemplateEngine();
    try {
      engine.configure();
      engine.prepareRender();
      engine.setContextValue("family", rendererAnnotation.family());
      engine.setContextValue("type", rendererAnnotation.type());
      engine.setContextValue("classname", currentClass.getName());
      engine.renderTemplate(stringWriter, "renderer.vm");
      String kit = rendererAnnotation.kit();
      RenderKit renderKit = this.facesConfig.getKits().get(kit);
      if (renderKit == null) {
        renderKit = new RenderKit();
      }
View Full Code Here

        component.getAttributes().add(attribute);
      }
    }

    StringWriter writerForGeneratedCode = new StringWriter();
    VelocityTemplateEngine engine = new VelocityTemplateEngine();
    try {
      engine.configure();
      engine.prepareRender();
      engine.setContextValue("component", component);
      engine.renderTemplate(writerForGeneratedCode, "componentAttributeGetSet.vm");
      if (log.isDebugEnabled()) {
        log.debug(writerForGeneratedCode.toString());
      }
      return writerForGeneratedCode.toString();
    } catch (Exception e) {
View Full Code Here

    try {     
      String filename = path + "/" + this.tld.getFilename();
      log.debug("Output file is " + filename + ".");
      BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(filename));
      log.debug("Output file created.");
      VelocityTemplateEngine engine = new VelocityTemplateEngine();
      engine.configure();
      engine.prepareRender();
      engine.setContextValue("tld",tld);
      engine.renderTemplate(bufferedWriter,"tld.vm");
      bufferedWriter.close();
      log.debug("Your TLD file is ready. ;o))");
    } catch (Exception e1) {     
      e1.printStackTrace();
   
View Full Code Here

        tag.getAttributes().add(attribute);
      }
    }

    StringWriter writerForGeneratedCode = new StringWriter();
    VelocityTemplateEngine engine = new VelocityTemplateEngine();
    try {
      engine.configure();
      engine.prepareRender();
      engine.setContextValue("tag", tag);
      engine.renderTemplate(writerForGeneratedCode, "tagSetProperties.vm");
      if (log.isDebugEnabled()) {
        log.debug(writerForGeneratedCode.toString());
      }
      return writerForGeneratedCode.toString();
    } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.xulfaces.annotation.processor.VelocityTemplateEngine

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.