Examples of TemplateLoader


Examples of com.facebook.swift.generator.util.TemplateLoader

            serviceMap.put(s, Files.getNameWithoutExtension(filename));
        }

        this.thriftTypeRenderer = new ThriftTypeRenderer(typenameMap.build());
        ThriftServiceMetadataRenderer serviceRenderer = new ThriftServiceMetadataRenderer(serviceMap.build());
        TemplateLoader tl = new TemplateLoader(ImmutableList.of("thrift/common.st"),
                ImmutableMap.of(ThriftType.class, thriftTypeRenderer, ThriftServiceMetadata.class, serviceRenderer));
        ThriftContext ctx = new ThriftContext(packageName, ImmutableList.copyOf(includes.build()), thriftTypes, thriftServices, namespaceMap);
        ST template = tl.load("thriftfile");
        template.add("context", ctx);
        template.write(new AutoIndentWriter(outputStreamWriter));
        outputStreamWriter.flush();
    }
View Full Code Here

Examples of com.facebook.swift.generator.util.TemplateLoader

            outputFolder.mkdirs();
        }

        LOG.debug("Writing source files into {} using {} ...", outputFolder, swiftGeneratorConfig.getCodeFlavor());

        this.templateLoader = new TemplateLoader(TEMPLATES.get(swiftGeneratorConfig.getCodeFlavor()));
    }
View Full Code Here

Examples of com.facebook.swift.generator.util.TemplateLoader

            serviceMap.put(s, Files.getNameWithoutExtension(filename));
        }

        this.thriftTypeRenderer = new ThriftTypeRenderer(typenameMap.build());
        ThriftServiceMetadataRenderer serviceRenderer = new ThriftServiceMetadataRenderer(serviceMap.build());
        TemplateLoader tl = new TemplateLoader(ImmutableList.of("thrift/common.st"),
                ImmutableMap.of(
                        ThriftType.class, thriftTypeRenderer,
                        ThriftServiceMetadata.class, serviceRenderer,
                        Requiredness.class, new FieldRequirednessRenderer()));
        ThriftContext ctx = new ThriftContext(packageName, ImmutableList.copyOf(includes.build()), thriftTypes, thriftServices, namespaceMap);
        ST template = tl.load("thriftfile");
        template.add("context", ctx);
        template.write(new AutoIndentWriter(outputStreamWriter));
        outputStreamWriter.flush();
    }
View Full Code Here

Examples of com.facebook.swift.generator.util.TemplateLoader

            outputFolder.mkdirs();
        }

        LOG.debug("Writing source files into {} using {} ...", outputFolder, swiftGeneratorConfig.getCodeFlavor());

        this.templateLoader = new TemplateLoader(TEMPLATES.get(swiftGeneratorConfig.getCodeFlavor()));
    }
View Full Code Here

Examples of com.github.jknack.handlebars.io.TemplateLoader

        if (indexHtml == null) {
            WebApp app = (WebApp) WebApp.getApp(request);
            Map<String, List<String>> context = new HashMap<String, List<String>>();
            context.put(PLUGIN_JS_RESOURCES_PARAM, app.getPluginsJsResources());
            context.put(PLUGIN_CSS_RESOURCES_PARAM, app.getPluginsCssResources());
            TemplateLoader templateLoader = new ServletContextTemplateLoader(request.getServletContext(), "/", ".hbs");
            Handlebars handlebars = new Handlebars(templateLoader);
            Template template = handlebars.compile("index");
            indexHtml = template.apply(context);
        }
        return indexHtml;
View Full Code Here

Examples of com.github.jknack.handlebars.io.TemplateLoader

            prefix = views;
        } else {
            prefix = views.endsWith("/") ? views : views + "/";
        }

        handlebars = new Handlebars(new TemplateLoader() {
            @Override
            public TemplateSource sourceAt(final String location) throws IOException {
                // load from the file system
                final String buffer = read(resolve(location));
View Full Code Here

Examples of com.google.clearsilver.jsilver.template.TemplateLoader

    // Applies optimizations to improve performance.
    // These steps are entirely optional, and are not required for correctness.
    templateFactory = setupOptimizerFactory(templateFactory);

    TemplateLoader templateLoader;
    List<DelegatingTemplateLoader> delegatingTemplateLoaders =
        new LinkedList<DelegatingTemplateLoader>();
    AutoEscapeOptions autoEscapeOptions = new AutoEscapeOptions();
    autoEscapeOptions.setPropagateEscapeStatus(options.getPropagateEscapeStatus());
    autoEscapeOptions.setLogEscapedVariables(options.getLogEscapedVariables());
View Full Code Here

Examples of de.neuland.jade4j.template.TemplateLoader

            prefix = views;
        } else {
            prefix = views.endsWith("/") ? views : views + "/";
        }

        config.setTemplateLoader(new TemplateLoader() {
            @Override
            public long getLastModified(String name) throws IOException {
                return Jade4JEngine.this.lastModified(name);
            }
View Full Code Here

Examples of freemarker.cache.TemplateLoader

    private Configuration initFTLConfig(InitParams initParams,
            AppResources resources, String ftlPath) {
       
        logger.debug("initializing freemarker Configuration...");
        Configuration config = new Configuration();
        TemplateLoader templateLoader = getTemplateLoader(initParams, resources, ftlPath);
        config.setTemplateLoader(templateLoader);
        config.setObjectWrapper(new DefaultObjectWrapper());
        return config;
    }
View Full Code Here

Examples of freemarker.cache.TemplateLoader

        Map vars = new HashMap();
        vars.put("name", "value");

        Configuration conf = FreemarkerTemplateEngine.createConfiguration(loader, settings, vars, null);

        TemplateLoader templateLoader = conf.getTemplateLoader();
        assertTrue(ResourceLoaderTemplateLoader.class.isInstance(templateLoader));
        ResourceLoaderTemplateLoader resourceLoaderTemplateLoader = (ResourceLoaderTemplateLoader) templateLoader;
        assertSame(loader, resourceLoaderTemplateLoader.getResourceLoader());

        assertEquals(6, conf.getSharedVariableNames().size());
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.