Renders given template to the given character stream.

@param template Previously loaded template to render
@param out Character stream to write to
@param extraGlobalScopes Any extra global scopes to make available
@throws IOException
967250
public void render(Template template, Writer out, GlobalScope... extraGlobalScopes) throws IOException {
    newInterpreter(extraGlobalScopes).process((TemplateImpl) template, out);
  }
640499
public static void write(final String templateFilename, final Map<String, Object> data,
            final Writer writer) {
        Template tmpl = null;
        try {
            /*-
             * note that we don't need to cache templates by ourselves since getTemplate() does that internally already
             */
            tmpl = conf.getTemplate(templateFilename);
        } catch (FileNotFoundException e1) {
            String errMsg = "FileNotFoundException: template file '" + templateFilename
                    + "' not found";
            log.error("{}: {}", errMsg, e1.getMessage());
            throw new AwsMockException(errMsg, e1);
        } catch (IOException e) {
            String errMsg = "IOException: failed to getTemplate (filename is " + templateFilename
                    + ")";
            log.error("{}: {}", errMsg, e.getMessage());
            throw new AwsMockException(errMsg, e);
        }

        try {
            tmpl.process(data, writer);
        } catch (TemplateException e) {
            StringBuilder dataDescription = new StringBuilder();

            if (null != data) {
                for (Map.Entry<String, Object> entry : data.entrySet()) {
                    dataDescription.append(entry.getKey() + " - " + entry.getValue()).append('\n');
                }
            }
            String errMsg = "TemplateException: failed to process template '" + templateFilename
                    + "', with data: "
                    + dataDescription.toString()
                    + " The probable cause could be un-matching of key-values for that template. ";
            log.error("{}: {}", errMsg, e.getMessage());
            throw new AwsMockException(errMsg, e);
        } catch (IOException e) {
            String errMsg = "IOException: failed to process template and write to writer. ";
            log.error("{}: {}", errMsg, e.getMessage());
            throw new AwsMockException(errMsg, e);
        }

    }
863080
def render_template(template_in, file_out, context):
    
    renderer = pystache.Renderer()
    result = renderer.render_path(template_in, context)
    with open(file_out, 'w') as handle:
        LOGGER.info('Rendering: {} to {}'.format(template_in, file_out))
        handle.write(result)
    shutil.copymode(template_in, file_out)
901050
public static String template(final String template, final Object root)
	{
		StrSubstitutor substitutor = new StrSubstitutor(newOgnlLookup(root));

		return substitutor.replace(template);
	}
1038731
public String renderInline(String text, GlobalScope... extraGlobalScopes) throws IOException, ParseException {
    return render(loadInline(text), extraGlobalScopes);
  }
1124661
private List<OutputFile> processTemplates(List<TemplateFile> inputs) throws IOException {
    List<OutputFile> outputs = new ArrayList<>();
    for (TemplateFile f : inputs) {
      String fileName = f.getFileName();
      if (!fileName.contains("VType") && fileName.contains("KType")) {
        for (Type ktype : Type.values()) {
          TemplateOptions options = new TemplateOptions(ktype);
          options.templateFile = f.path;
          generate(f, outputs, options);
        }
      }
      if (fileName.contains("KTypeVType")) {
        for (Type ktype : Type.values()) {
          for (Type vtype : Type.values()) {
            TemplateOptions options = new TemplateOptions(ktype, vtype);
            options.templateFile = f.path;
            generate(f, outputs, options);
          }
        }
      }
    }
    return outputs;
  }
509595
public void addTemplate(String template) {
	  if (lock == SET) {
		 throw new IllegalStateException("EntryInfo is locked");
	  }
	  if (template != null && !template.equals("")) {
		  templates.add(template);
	  }
   }
833059
public void loadRefasterJsTemplate(String refasterjsTemplate) throws IOException  {
    checkState(
        templateJs == null, "Can't load RefasterJs template since a template is already loaded.");
    this.templateJs =
        Thread.currentThread().getContextClassLoader().getResource(refasterjsTemplate) != null
            ? Resources.toString(Resources.getResource(refasterjsTemplate), UTF_8)
            : Files.asCharSource(new File(refasterjsTemplate), UTF_8).read();
  }
669545
@Override
  @NotOnCli
  public EmbeddedGobblin setTemplate(String templateURI)
      throws URISyntaxException, SpecNotFoundException, JobTemplate.TemplateException {
    return super.setTemplate(templateURI);
  }
482890
private final void renderContentTemplate(final ST contentTemplate, final Writer writer, final Map<String, Object> values/*, final String language*/, final ErrorBuffer error) {
        injectTemplateValues(contentTemplate, values);
//        if (language == null)
            contentTemplate.write(createSTWriter(writer), error);
//        else
//            contentTemplate.write(createSTWriter(writer), new Locale(language), error);
    }
742349
@Override
    public void render(ElementTemplate eleTemplate, Object data, XWPFTemplate template) {
        RunTemplate runTemplate = (RunTemplate) eleTemplate;
        // validate
        if (!validate(data)) {
            clearPlaceholder(runTemplate.getRun());
            return;
        }

        // do render
        try {
            doRender(runTemplate, data, template);
        } catch (Exception e) {
            doRenderException(runTemplate, data, e);
        }

    }
448599
public void write(final OutputStream out, final Stream<? extends Triple> triples, final IRI subject) {
        final Writer writer = new OutputStreamWriter(out, UTF_8);
        try {
            template
                .execute(writer, new HtmlData(namespaceService, subject, triples.collect(toList()), properties))
                .flush();
        } catch (final IOException ex) {
            throw new UncheckedIOException(ex);
        }
    }
436607
public Template parseTeaTemplate(String templateName) throws IOException {

        if (templateName == null) {
            return null;
        }

        preserveParseTree(templateName);
        compile(templateName);
        CompilationUnit unit = getCompilationUnit(templateName, null);
        if (unit == null) {
            return null;
        }

        return unit.getParseTree();
    }
20314
function renderTemplate(contents, data, filename) {
    if (!templateCache.hasOwnProperty(contents)) {
      var jadeOptions = merge.recursive({}, options.jadeOptions, {filename: filename});
      templateCache[contents] = options.jade.compile(contents, jadeOptions);
    }
    var locals = merge.recursive({}, data, {locals: locals});
    return templateCache[contents](data);
  }
5199
@Override
    public void execute(Environment env, Map params, TemplateModel[] loopVars, TemplateDirectiveBody body) throws TemplateException, IOException {
        StringWriter stringWriter = new StringWriter();
        WhereContext whereContext = new WhereContext(env.getCustomAttribute("whereTag"));
        env.setCustomAttribute("whereTag", whereContext);
        body.render(stringWriter);
        if (params.size() != 0 && !((Map.Entry)params.entrySet().toArray()[0]).getKey().equals("type"))
        {
            String message = "This directive only takes 'type' with a value of either 'AND' or 'OR'.";
            errors.add(message);
            throw new TemplateModelException(message);
        }
        Object typeParam = params.get("type");
        if (typeParam instanceof TemplateScalarModel)
        {
            TemplateScalarModel typeScalar = (TemplateScalarModel) typeParam;
            if (StringUtils.isNotBlank(typeScalar.getAsString()))
                whereContext.setConnector(typeScalar.getAsString().toUpperCase());
        }
        if (!Arrays.asList("AND", "OR").contains(whereContext.getConnector()))
        {
            String message = "This directive only takes 'type' with a value of either 'AND' or 'OR'.";
            errors.add(message);
            throw new TemplateModelException(message);
        }

        String outputBody = StringUtils.join(whereContext.getFreemarkerWhereClauses(), " " + whereContext.getConnector() + " ");
        if (whereContext.getFreemarkerWhereClauses().size() > 1 && whereContext.getParent() != null && !whereContext.getParent().getConnector().equals(whereContext.getConnector()))
            outputBody = "(" + outputBody + ")";
        if (StringUtils.isNotBlank(outputBody)) {
            if (whereContext.getParent() == null)
                env.getOut().write(" WHERE ");
            if (whereContext.getParent() != null)
                whereContext.getParent().addWhereBody(outputBody);
            else
                env.getOut().write(outputBody);
        }
        env.setCustomAttribute("whereTag", whereContext.getParent());
    }
87332
public Renderable<?> render(Template template, Map<String, Object> parameters) {
        return template.render(this, parameters);
    }
788164
function(template) {

		this._view.getContainer().prependHTML(template.render());
		template.broadcastInDOM();
		this._current_templates.unshift(template);

	}