Package freemarker.template

Examples of freemarker.template.DefaultObjectWrapper


   public FreemarkerTemplateProcessor()
   {
      freemarkerConfig = new freemarker.template.Configuration();
      freemarkerConfig.setClassForTemplateLoading(getClass(), "/");
      freemarkerConfig.setObjectWrapper(new DefaultObjectWrapper());
   }
View Full Code Here


  private void saveTemplates() {
    // freemarker configuration
    Configuration config = new Configuration();
    config.setClassForTemplateLoading(getClass(), "");
    config.setObjectWrapper(new DefaultObjectWrapper());

    try {
      // load template
      Template template = config.getTemplate("tag.ftl");
      String rootDir = (new File(getOption("outTemplatesDir"))).getAbsolutePath();
View Full Code Here

     */
    public String processTemplate(String name,
                                  Map<String, Object> data) {
        try {
            Configuration configuration = new Configuration();
            configuration.setObjectWrapper( new DefaultObjectWrapper() );
            configuration.setTemplateUpdateDelay( 0 );

            Template template = new Template( name,
                                              new InputStreamReader( ServiceImplementation.class.getResourceAsStream( "/repoconfig/" + name + ".xml" ) ),
                                              configuration );
View Full Code Here

 
  protected DataHandler processTemplate(final String name, InputStream src, Map<String, Object> renderContext) {
    DataHandler merged = null;
    try {
      freemarker.template.Configuration cfg = new freemarker.template.Configuration();
      cfg.setObjectWrapper(new DefaultObjectWrapper());
      cfg.setTemplateUpdateDelay(0);
      Template temp = new Template(name, new InputStreamReader(src), cfg);
      final ByteArrayOutputStream bout = new ByteArrayOutputStream();
      Writer out = new OutputStreamWriter(bout);
      temp.process(renderContext, out);
View Full Code Here

        try
        {
            Configuration config = new Configuration();
            config.setClassForTemplateLoading(getClass(), "");
            config.setObjectWrapper(new DefaultObjectWrapper());

            Template templateEngine = config.getTemplate(name);
            templateEngine.process(model, new PrintWriter(output));

        }
View Full Code Here

     */
    public String processTemplate(String name,
                                  Map<String, Object> data) {
        try {
            Configuration configuration = new Configuration();
            configuration.setObjectWrapper( new DefaultObjectWrapper() );
            configuration.setTemplateUpdateDelay( 0 );

            Template template = new Template( name,
                                              new InputStreamReader( ServiceImplementation.class.getResourceAsStream( "/repoconfig/" + name + ".xml" ) ),
                                              configuration );
View Full Code Here

 
  protected DataHandler processTemplate(final String name, InputStream src, Map<String, Object> renderContext) {
    DataHandler merged = null;
    try {
      freemarker.template.Configuration cfg = new freemarker.template.Configuration();
      cfg.setObjectWrapper(new DefaultObjectWrapper());
      cfg.setTemplateUpdateDelay(0);
      Template temp = new Template(name, new InputStreamReader(src), cfg);
      final ByteArrayOutputStream bout = new ByteArrayOutputStream();
      Writer out = new OutputStreamWriter(bout);
      temp.process(renderContext, out);
View Full Code Here

    {
      this.cfg = new Configuration();

      this.cfg.setDirectoryForTemplateLoading(new File(Espeon.templatePath));

      this.cfg.setObjectWrapper(new DefaultObjectWrapper());
    }
    else
    {
      throw new Exception("You have to create the template directory: '" + templatePath.getAbsolutePath());
    }
View Full Code Here

        this.delegate = delegate;

        Configuration config = new Configuration();
        config.setClassForTemplateLoading(getClass(), "");
        config.setObjectWrapper(new DefaultObjectWrapper());

        ByteArrayOutputStream byteArrayOutputStream;
        try {
            Template template = config.getTemplate("v2/ejb-jar.xml.ftl");
View Full Code Here

        return attrNode.getNodeValue();
    }

    public static String transformToHtml(Set<String> variableNames, String ftlText) throws IOException, TemplateException {
        Configuration cfg = new Configuration();
        cfg.setObjectWrapper(new DefaultObjectWrapper());
        cfg.setLocalizedLookup(false);
        Template template = new Template("test", new StringReader(ftlText), cfg, PluginConstants.UTF_ENCODING);
        StringWriter out = new StringWriter();
        template.process(new EditorHashModel(variableNames), out);
        out.flush();
View Full Code Here

TOP

Related Classes of freemarker.template.DefaultObjectWrapper

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.