Search in sources :

Example 11 with PebbleException

use of com.mitchellbosecke.pebble.error.PebbleException in project symja_android_library by axkr.

the class BarTrace 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();
}
Also used : PebbleException(com.mitchellbosecke.pebble.error.PebbleException) StringWriter(java.io.StringWriter) PebbleTemplate(com.mitchellbosecke.pebble.template.PebbleTemplate) UncheckedIOException(java.io.UncheckedIOException) UncheckedIOException(java.io.UncheckedIOException) IOException(java.io.IOException) StringWriter(java.io.StringWriter) Writer(java.io.Writer)

Example 12 with PebbleException

use of com.mitchellbosecke.pebble.error.PebbleException in project symja_android_library by axkr.

the class ContourTrace 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());
    } catch (PebbleException e) {
        throw new IllegalStateException(e);
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
    return writer.toString();
}
Also used : PebbleException(com.mitchellbosecke.pebble.error.PebbleException) StringWriter(java.io.StringWriter) PebbleTemplate(com.mitchellbosecke.pebble.template.PebbleTemplate) UncheckedIOException(java.io.UncheckedIOException) UncheckedIOException(java.io.UncheckedIOException) IOException(java.io.IOException) StringWriter(java.io.StringWriter) Writer(java.io.Writer)

Example 13 with PebbleException

use of com.mitchellbosecke.pebble.error.PebbleException in project symja_android_library by axkr.

the class Histogram2DTrace 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();
}
Also used : PebbleException(com.mitchellbosecke.pebble.error.PebbleException) StringWriter(java.io.StringWriter) PebbleTemplate(com.mitchellbosecke.pebble.template.PebbleTemplate) UncheckedIOException(java.io.UncheckedIOException) UncheckedIOException(java.io.UncheckedIOException) IOException(java.io.IOException) StringWriter(java.io.StringWriter) Writer(java.io.Writer)

Example 14 with PebbleException

use of com.mitchellbosecke.pebble.error.PebbleException in project symja_android_library by axkr.

the class PieTrace method asJavascript.

@Override
public String asJavascript(int i) {
    Writer writer = new StringWriter();
    PebbleTemplate compiledTemplate;
    try {
        compiledTemplate = engine.getTemplate("pie_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();
}
Also used : PebbleException(com.mitchellbosecke.pebble.error.PebbleException) StringWriter(java.io.StringWriter) PebbleTemplate(com.mitchellbosecke.pebble.template.PebbleTemplate) UncheckedIOException(java.io.UncheckedIOException) UncheckedIOException(java.io.UncheckedIOException) IOException(java.io.IOException) StringWriter(java.io.StringWriter) Writer(java.io.Writer)

Example 15 with PebbleException

use of com.mitchellbosecke.pebble.error.PebbleException in project symja_android_library by axkr.

the class Figure method asJavascript.

public String asJavascript(String divName) {
    Writer writer = new StringWriter();
    PebbleTemplate compiledTemplate;
    buildContext(divName);
    try {
        compiledTemplate = engine.getTemplate("figure_template.html");
        compiledTemplate.evaluate(writer, getContext());
    } catch (PebbleException e) {
        throw new IllegalStateException(e);
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
    return writer.toString();
}
Also used : PebbleException(com.mitchellbosecke.pebble.error.PebbleException) StringWriter(java.io.StringWriter) PebbleTemplate(com.mitchellbosecke.pebble.template.PebbleTemplate) UncheckedIOException(java.io.UncheckedIOException) IOException(java.io.IOException) UncheckedIOException(java.io.UncheckedIOException) StringWriter(java.io.StringWriter) Writer(java.io.Writer)

Aggregations

PebbleException (com.mitchellbosecke.pebble.error.PebbleException)17 StringWriter (java.io.StringWriter)16 Writer (java.io.Writer)16 PebbleTemplate (com.mitchellbosecke.pebble.template.PebbleTemplate)15 IOException (java.io.IOException)15 UncheckedIOException (java.io.UncheckedIOException)15 PebbleEngine (com.mitchellbosecke.pebble.PebbleEngine)2 Utils.dataAsString (tech.tablesaw.plotly.Utils.dataAsString)2 NoOpMethodAccessValidator (com.mitchellbosecke.pebble.attributes.methodaccess.NoOpMethodAccessValidator)1 NodeVisitorFactory (com.mitchellbosecke.pebble.extension.NodeVisitorFactory)1 LexerImpl (com.mitchellbosecke.pebble.lexer.LexerImpl)1 TokenStream (com.mitchellbosecke.pebble.lexer.TokenStream)1 ClasspathLoader (com.mitchellbosecke.pebble.loader.ClasspathLoader)1 DelegatingLoader (com.mitchellbosecke.pebble.loader.DelegatingLoader)1 FileLoader (com.mitchellbosecke.pebble.loader.FileLoader)1 Loader (com.mitchellbosecke.pebble.loader.Loader)1 RootNode (com.mitchellbosecke.pebble.node.RootNode)1 Parser (com.mitchellbosecke.pebble.parser.Parser)1 ParserImpl (com.mitchellbosecke.pebble.parser.ParserImpl)1 ParserOptions (com.mitchellbosecke.pebble.parser.ParserOptions)1