Package freemarker.template

Examples of freemarker.template.DefaultObjectWrapper


    public void renderPojo(Object pojo, final String templatePath, Writer out) {   
        Configuration freemarker= new Configuration();
        freemarker.setDefaultEncoding("utf-8");
        freemarker.setOutputEncoding("utf-8");
        freemarker.setLocalizedLookup(false);
        freemarker.setObjectWrapper(new DefaultObjectWrapper());
        freemarker.setTemplateLoader(templateLoader);
        try {
            //should root be a map instead?
            freemarker.getTemplate(templatePath).process(pojo, out);
            out.flush();
View Full Code Here


        try
        {
            freemarker.template.Configuration cfg = new freemarker.template.Configuration();
            cfg.setTemplateLoader(new SimpleURLTemplateLoader(base.get()));
            cfg.setObjectWrapper(new DefaultObjectWrapper());
            cfg.setLocalizedLookup(localized.get());
            return Optional.fromNullable(cfg.getTemplate(path.get()));
        }
        catch (IOException e)
        {
View Full Code Here

            addChart(id, name, pid, chart);
        }

        Configuration cfg = new Configuration();
        cfg.setClassForTemplateLoading(ChartOfAccountReport.class, "/");
        cfg.setObjectWrapper(new DefaultObjectWrapper());

        Template temp = cfg.getTemplate(TEMPLATE_NAME);

        Map<String, Object> root = new HashMap<String, Object>();
        root.put("chart", chart);
View Full Code Here

            addChart(id, name, pid, chart);
        }

        Configuration cfg = new Configuration();
        cfg.setClassForTemplateLoading(ChartOfAccountReport.class, "/");
        cfg.setObjectWrapper(new DefaultObjectWrapper());

        Template temp = cfg.getTemplate(TEMPLATE_NAME);

        List<GenericValue> partyGroup = null;
        try {
View Full Code Here

            journal.add(acctgTransMap);
        }

        Configuration cfg = new Configuration();
        cfg.setClassForTemplateLoading(ChartOfAccountReport.class, "/");
        cfg.setObjectWrapper(new DefaultObjectWrapper());

        Template temp = cfg.getTemplate(TEMPLATE_NAME);

        Map<String, Object> root = new HashMap<String, Object>();
        root.put("journal", journal);
View Full Code Here

  public void generateXsdFile(final Collection<ConfigClass> configClasses, String configClassPackage,
                              final Writer output) throws IOException, TemplateException {
    ExmlConfigPackage suite = new ExmlConfigPackage(configClasses, configClassPackage);
    Configuration cfg = new Configuration();
    cfg.setClassForTemplateLoading(ExmlConfigPackage.class, "/");
    cfg.setObjectWrapper(new DefaultObjectWrapper());
    Template template = cfg.getTemplate("/net/jangaroo/exml/templates/exml_config_package_xsd.ftl");
    Environment env = template.createProcessingEnvironment(suite, output);
    env.setOutputEncoding(Exmlc.OUTPUT_CHARSET);
    env.process();
  }
View Full Code Here

    if (configClass.getSuperClassName() == null) {
      throw new ExmlcException("Config class " + configClass.getFullName() + "'s super class name is null!");
    }
    Configuration cfg = new Configuration();
    cfg.setClassForTemplateLoading(ConfigClass.class, "/");
    cfg.setObjectWrapper(new DefaultObjectWrapper());
    Template template = cfg.getTemplate("/net/jangaroo/exml/templates/exml_config_class.ftl");
    Environment env = template.createProcessingEnvironment(configClass, output);
    env.setOutputEncoding(Exmlc.OUTPUT_CHARSET);
    env.process();
  }
View Full Code Here

  }

  public void generateClass(final ExmlModel model, final Writer output) throws IOException, TemplateException {
    Configuration cfg = new Configuration();
    cfg.setClassForTemplateLoading(ExmlComponentClassModel.class, "/");
    cfg.setObjectWrapper(new DefaultObjectWrapper());
    Template template = cfg.getTemplate("/net/jangaroo/exml/templates/exml_component_class.ftl");
    ExmlComponentClassModel exmlComponentClassModel = new ExmlComponentClassModel(model);
    Environment env = template.createProcessingEnvironment(exmlComponentClassModel, output);
    env.setOutputEncoding(Exmlc.OUTPUT_CHARSET);
    env.process();
View Full Code Here

        return packageName.replaceAll("\\.", Matcher.quoteReplacement(File.separator));
    }

    protected Configuration getFreemarkerConfiguration(final String templatePath) {
        final Configuration config = new Configuration();
        config.setObjectWrapper(new DefaultObjectWrapper());
        config.setClassForTemplateLoading(getClass(), templatePath);
        return config;
    }
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

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.