Examples of VelocityRenderer


Examples of org.apache.tiles.request.velocity.render.VelocityRenderer

                .setParameter("number_format", "0.##########")
                .setParameter(SharedVariableLoaderFreemarkerServlet.CUSTOM_SHARED_VARIABLE_FACTORIES_INIT_PARAM,
                        "tiles," + TilesSharedVariableFactory.class.getName()).build();
        rendererFactory.registerRenderer(FREEMARKER_RENDERER_NAME, freemarkerRenderer);

        VelocityRenderer velocityRenderer = VelocityRendererBuilder.createInstance()
                .setApplicationContext(applicationContext).build();
        rendererFactory.registerRenderer(VELOCITY_RENDERER_NAME, velocityRenderer);

        MustacheRenderer mustacheRenderer = new MustacheRenderer();
        mustacheRenderer.setAcceptPattern(Pattern.compile(".+\\.mustache"));
View Full Code Here

Examples of org.apache.tiles.request.velocity.render.VelocityRenderer

                .setParameter("number_format", "0.##########")
                .setParameter(SharedVariableLoaderFreemarkerServlet.CUSTOM_SHARED_VARIABLE_FACTORIES_INIT_PARAM,
                        "tiles," + TilesSharedVariableFactory.class.getName()).build();
        rendererFactory.registerRenderer(FREEMARKER_RENDERER_NAME, freemarkerRenderer);

        VelocityRenderer velocityRenderer = VelocityRendererBuilder.createInstance()
                .setApplicationContext(applicationContext).build();
        rendererFactory.registerRenderer(VELOCITY_RENDERER_NAME, velocityRenderer);

        MustacheRenderer mustacheRenderer = new MustacheRenderer();
        mustacheRenderer.setAcceptPattern(Pattern.compile(".+\\.mustache"));
View Full Code Here

Examples of pt.opensoft.text.VelocityRenderer

        }
    }

    private void renderClass(StoredProcedure storedProcedure, String template, File outputFile) throws Exception {

        VelocityRenderer renderer = new VelocityRenderer(template);
        initContext(renderer, storedProcedure);
       
        FileWriter writer = new FileWriter(outputFile);
      try {
          renderer.renderToWriter(writer);
        writer.flush();
      } finally {
          writer.close();
      }
        log("Output: " + outputFile, Project.MSG_INFO);
View Full Code Here

Examples of pt.opensoft.text.VelocityRenderer

        JavaClass clazz = source.getClasses()[0];
       
        log("Generating validator for " + clazz.getFullyQualifiedName());
       
        VelocityRenderer.initVelocityEngine(null, "file, classpath");
        VelocityRenderer renderer = new VelocityRenderer("validator.vsl");
        renderer.addToContext("class", clazz);

        String fileName = srcDir + "/" + clazz.getPackage().replace('.', '/') + "/" + clazz.getName() + "Validator.java";
        FileWriter writer = new FileWriter(fileName);
        renderer.renderToWriter(writer);
        writer.close();
    }
View Full Code Here

Examples of pt.opensoft.text.VelocityRenderer

      throw new BuildException("Generation failed with exception " + e.getClass() + ": " + e.getLocalizedMessage() + ".");
    }
  }

  private void renderBean(Element root, File destFile) throws Exception {
    VelocityRenderer renderer = new VelocityRenderer(BEAN_TEMPLATE);
    initContext(renderer, root);
    try {
      FileWriter writer = new FileWriter(destFile);
      try {
        renderer.renderToWriter(writer);
        writer.flush();
      } finally {
        writer.close();
      }
      log("Done: " + destFile);
View Full Code Here

Examples of pt.opensoft.text.VelocityRenderer

        }
    }

    private void renderFile(Document root, Message message, OneWayMessage oneWayMessage, String template, File outFile) throws Exception {

        VelocityRenderer renderer = new VelocityRenderer(template);
        initContext(renderer, root, message);
        renderer.addToContext("message", oneWayMessage);
        FileWriter writer = new FileWriter(outFile);
      try {
          renderer.renderToWriter(writer);
        writer.flush();
      } finally {
          writer.close();
      }
        log("Output: " + outFile, Project.MSG_INFO);
View Full Code Here

Examples of pt.opensoft.text.VelocityRenderer

      }
        log("Output: " + outFile, Project.MSG_INFO);
    }

    private void renderFile(Document root, Message message, Object block, String template, File outFile) throws Exception {
        VelocityRenderer renderer = new VelocityRenderer(template);
        initContext(renderer, root, message);
        renderer.addToContext("message", block);
        FileWriter writer = new FileWriter(outFile);
        renderer.renderToWriter(writer);
        writer.flush();
        writer.close();
        log("Output: " + outFile, Project.MSG_INFO);
    }
View Full Code Here

Examples of pt.opensoft.text.VelocityRenderer

        File exceptionDestDir = new File(realDestDir, EXCEPTION_PACKAGE);
        exceptionDestDir.mkdirs();

        File outFile = new File(exceptionDestDir, outputClassName + "Exception" + EXTENSION);

        VelocityRenderer renderer = new VelocityRenderer(MESSAGE_EXCEPTION_CLASS_TEMPLATE);
        initContext(renderer, root, message);
        renderer.addToContext("message", message);
        renderer.addToContext("exception", outputClassName + "Exception");
        FileWriter writer = new FileWriter(outFile);
        renderer.renderToWriter(writer);
        writer.flush();
        writer.close();
        log("Output: " + outFile, Project.MSG_INFO);
    }
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.