use of com.mitchellbosecke.pebble.template.PebbleTemplate in project symja_android_library by axkr.
the class BoxTrace method asJavascript.
@Override
public String asJavascript(int i) {
Writer writer = new StringWriter();
PebbleTemplate compiledTemplate;
try {
compiledTemplate = engine.getTemplate("trace_template.html");
compiledTemplate.evaluate(writer, getContext(i));
} catch (PebbleException e) {
throw new IllegalStateException(e);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
return writer.toString();
}
use of com.mitchellbosecke.pebble.template.PebbleTemplate in project symja_android_library by axkr.
the class HistogramTrace method asJavascript.
@Override
public String asJavascript(int i) {
Writer writer = new StringWriter();
PebbleTemplate compiledTemplate;
try {
compiledTemplate = engine.getTemplate("trace_template.html");
compiledTemplate.evaluate(writer, getContext(i));
} catch (PebbleException e) {
throw new IllegalStateException(e);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
return writer.toString();
}
use of com.mitchellbosecke.pebble.template.PebbleTemplate in project symja_android_library by axkr.
the class Component method asJavascript.
protected String asJavascript(String filename) {
Writer writer = new StringWriter();
PebbleTemplate compiledTemplate;
try {
compiledTemplate = getEngine().getTemplate(filename);
compiledTemplate.evaluate(writer, getContext());
} catch (PebbleException e) {
throw new IllegalStateException(e);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
return writer.toString();
}
use of com.mitchellbosecke.pebble.template.PebbleTemplate in project symja_android_library by axkr.
the class Layout method asJavascript.
public String asJavascript() {
Writer writer = new StringWriter();
PebbleTemplate compiledTemplate;
try {
compiledTemplate = engine.getTemplate("layout_template.html");
compiledTemplate.evaluate(writer, getContext());
} catch (PebbleException e) {
throw new IllegalStateException(e);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
return writer.toString();
}
use of com.mitchellbosecke.pebble.template.PebbleTemplate in project osiostatsgenerator by piyush1594.
the class StatsGenerator method printHTMLStats.
private static String printHTMLStats() throws PebbleException, IOException {
PebbleEngine engine = new PebbleEngine.Builder().build();
PebbleTemplate compiledTemplate = engine.getTemplate("templates/stats_table.html");
Writer writer = new StringWriter();
Map<String, Object> context = new HashMap<String, Object>();
context.put("websiteTitle", "OpenShift.io GitHub Stats");
context.put("stats", Stats);
context.put("now", Calendar.getInstance().getTime());
compiledTemplate.evaluate(writer, context);
String output = writer.toString();
return output;
}
Aggregations