Search in sources :

Example 1 with JinjavaConfig

use of com.hubspot.jinjava.JinjavaConfig in project zeppelin by apache.

the class K8sSpecTemplate method render.

public String render(String template) {
    ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
    try {
        Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
        JinjavaConfig config = JinjavaConfig.newBuilder().withLstripBlocks(true).withTrimBlocks(true).build();
        Jinjava jinja = new Jinjava(config);
        return jinja.render(template, this);
    } finally {
        Thread.currentThread().setContextClassLoader(oldCl);
    }
}
Also used : JinjavaConfig(com.hubspot.jinjava.JinjavaConfig) Jinjava(com.hubspot.jinjava.Jinjava)

Aggregations

Jinjava (com.hubspot.jinjava.Jinjava)1 JinjavaConfig (com.hubspot.jinjava.JinjavaConfig)1