Codota Logo
GroovyTemplateStub
Code IndexAdd Codota to your IDE (free)

How to use
GroovyTemplateStub
in
juzu.impl.template.spi.juzu.dialect.gtmpl

Best Java code snippets using juzu.impl.template.spi.juzu.dialect.gtmpl.GroovyTemplateStub (Showing top 14 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: org.juzu/juzu-core

@Override
public void doRender(TemplateRenderContext renderContext) throws TemplateExecutionException, IOException {
 Binding binding = new BindingImpl(renderContext);
 //
 Script script = InvokerHelper.createScript(scriptClass, binding);
 //
 try {
  script.run();
 }
 catch (Exception e) {
  if (e instanceof IOException) {
   throw (IOException)e;
  }
  else {
   throw buildRuntimeException(e);
  }
 }
 catch (Throwable e) {
  if (e instanceof Error) {
   throw ((Error)e);
  }
  throw buildRuntimeException(e);
 }
}
origin: org.juzu/juzu-core

@Test
public void testSiblingClosures() throws IOException, TemplateException {
 GroovyTemplateStub template = template("#{title value=a/}#{title value=b/}");
 template.getClassName();
}
origin: org.juzu/juzu-core

String script = getScript(loader, fqn);
GroovyCodeSource gcs = new GroovyCodeSource(new String(script.getBytes()), "myscript", "/groovy/shell");
GroovyClassLoader gcl = new GroovyClassLoader(loader, config);
origin: org.juzu/juzu-core

 @Test
 public void testCarriageReturn() throws Exception {
  GroovyTemplateStub s = template("a\r\nb");
  s.init();
  StringWriter out = new StringWriter();
  new TemplateRenderContext(s, Collections.<String, Object>emptyMap()).render(OutputStream.create(Tools.UTF_8, out));
  assertEquals("a\nb", out.toString());
 }
}
origin: org.juzu/juzu-core

@Test
public void testFoo() throws Exception {
 GroovyTemplateStub s = template("a<%=foo%>c");
 s.init();
 StringWriter out = new StringWriter();
 new TemplateRenderContext(s, Collections.<String, Object>singletonMap("foo", "b")).render(OutputStream.create(Tools.UTF_8, out));
 assertEquals("abc", out.toString());
}
origin: juzu/juzu

 @Test
 public void testCarriageReturn() throws Exception {
  GroovyTemplateStub s = template("a\r\nb");
  s.init();
  StringWriter out = new StringWriter();
  new TemplateRenderContext(s, Collections.<String, Object>emptyMap()).render(OutputStream.create(Tools.UTF_8, out));
  assertEquals("a\nb", out.toString());
 }
}
origin: juzu/juzu

@Test
public void testSiblingClosures() throws IOException, TemplateException {
 GroovyTemplateStub template = template("#{title value=a/}#{title value=b/}");
 template.getClassName();
}
origin: juzu/juzu

@Override
public void doRender(TemplateRenderContext renderContext) throws TemplateExecutionException, IOException {
 Binding binding = new BindingImpl(renderContext);
 //
 Script script = InvokerHelper.createScript(scriptClass, binding);
 //
 try {
  script.run();
 }
 catch (Exception e) {
  if (e instanceof IOException) {
   throw (IOException)e;
  }
  else {
   throw buildRuntimeException(e);
  }
 }
 catch (Throwable e) {
  if (e instanceof Error) {
   throw ((Error)e);
  }
  throw buildRuntimeException(e);
 }
}
origin: juzu/juzu

String script = getScript(loader, fqn);
GroovyCodeSource gcs = new GroovyCodeSource(new String(script.getBytes()), "myscript", "/groovy/shell");
GroovyClassLoader gcl = new GroovyClassLoader(loader, config);
origin: juzu/juzu

@Test
public void testFoo() throws Exception {
 GroovyTemplateStub s = template("a<%=foo%>c");
 s.init();
 StringWriter out = new StringWriter();
 new TemplateRenderContext(s, Collections.<String, Object>singletonMap("foo", "b")).render(OutputStream.create(Tools.UTF_8, out));
 assertEquals("abc", out.toString());
}
origin: juzu/juzu

 private void assertLineNumber(int expectedLineNumber, String expectedText, String script) throws IOException, TemplateException {
  GroovyTemplateStub template = template(script);
  try {
   new TemplateRenderContext(template).render(OutputStream.create());
   fail();
  }
  catch (TemplateExecutionException t) {
   assertEquals(expectedText, t.getText());
   assertEquals(expectedLineNumber, (Object)t.getLineNumber());
   StackTraceElement scriptElt = null;
   for (StackTraceElement elt : t.getCause().getStackTrace()) {
    if (elt.getClassName().equals(template.getClassName())) {
     scriptElt = elt;
     break;
    }
   }
   assertEquals(expectedLineNumber, scriptElt.getLineNumber());
  }
 }
}
origin: org.juzu/juzu-core

stub.init();
return stub;
origin: org.juzu/juzu-core

 private void assertLineNumber(int expectedLineNumber, String expectedText, String script) throws IOException, TemplateException {
  GroovyTemplateStub template = template(script);
  try {
   new TemplateRenderContext(template).render(OutputStream.create());
   fail();
  }
  catch (TemplateExecutionException t) {
   assertEquals(expectedText, t.getText());
   assertEquals(expectedLineNumber, (Object)t.getLineNumber());
   StackTraceElement scriptElt = null;
   for (StackTraceElement elt : t.getCause().getStackTrace()) {
    if (elt.getClassName().equals(template.getClassName())) {
     scriptElt = elt;
     break;
    }
   }
   assertEquals(expectedLineNumber, scriptElt.getLineNumber());
  }
 }
}
origin: juzu/juzu

stub.init();
return stub;
juzu.impl.template.spi.juzu.dialect.gtmplGroovyTemplateStub

Most used methods

  • buildRuntimeException
  • getClassName
  • getScript
  • init

Popular in Java

  • Making http post requests using okhttp
  • putExtra (Intent)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • onRequestPermissionsResult (Fragment)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • Timer (java.util)
    A facility for threads to schedule tasks for future execution in a background thread. Tasks may be s
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • JLabel (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now