ST template = group.getInstanceOf("YourTemplate"); OutputStreamWriter osWriter = new OutputStreamWriter(stream); STWriter stWriter = new AutoIndentWriter(osWriter); template.write(stWriter); osWriter.flush();
public String render(Locale locale, int lineWidth) { StringWriter out = new StringWriter(); STWriter wr = new AutoIndentWriter(out); wr.setLineWidth(lineWidth); write(wr, locale); return out.toString(); }
public String render(Locale locale, int lineWidth) { StringWriter out = new StringWriter(); STWriter wr = new AutoIndentWriter(out); wr.setLineWidth(lineWidth); write(wr, locale); return out.toString(); }
public String render(Locale locale, int lineWidth) { StringWriter out = new StringWriter(); STWriter wr = new AutoIndentWriter(out); wr.setLineWidth(lineWidth); write(wr, locale); return out.toString(); }
public String render(Locale locale, int lineWidth) { StringWriter out = new StringWriter(); STWriter wr = new AutoIndentWriter(out); wr.setLineWidth(lineWidth); write(wr, locale); return out.toString(); }
public String render(Locale locale, int lineWidth) { StringWriter out = new StringWriter(); STWriter wr = new AutoIndentWriter(out); wr.setLineWidth(lineWidth); write(wr, locale); return out.toString(); }
public String render(Locale locale, int lineWidth) { StringWriter out = new StringWriter(); STWriter wr = new AutoIndentWriter(out); wr.setLineWidth(lineWidth); write(wr, locale); return out.toString(); }
public String render(Locale locale, int lineWidth) { StringWriter out = new StringWriter(); STWriter wr = new AutoIndentWriter(out); wr.setLineWidth(lineWidth); write(wr, locale); return out.toString(); }
public String render(Locale locale, int lineWidth) { StringWriter out = new StringWriter(); STWriter wr = new AutoIndentWriter(out); wr.setLineWidth(lineWidth); write(wr, locale); return out.toString(); }
public void write(ST code, String fileName) throws IOException { //long start = System.currentTimeMillis(); Writer w = tool.getOutputFile(grammar, fileName); // Write the output to a StringWriter STWriter wr = new AutoIndentWriter(w); wr.setLineWidth(lineWidth); code.write(wr); w.close(); //long stop = System.currentTimeMillis(); //System.out.println("render time for "+fileName+": "+(int)(stop-start)+"ms"); }
public void write(ST code, String fileName) throws IOException { //long start = System.currentTimeMillis(); Writer w = tool.getOutputFile(grammar, fileName); // Write the output to a StringWriter STWriter wr = new AutoIndentWriter(w); wr.setLineWidth(lineWidth); code.write(wr); w.close(); //long stop = System.currentTimeMillis(); //System.out.println("render time for "+fileName+": "+(int)(stop-start)+"ms"); }
public List<InterpEvent> getEvents(Locale locale, int lineWidth) { StringWriter out = new StringWriter(); STWriter wr = new AutoIndentWriter(out); wr.setLineWidth(lineWidth); Interpreter interp = new Interpreter(groupThatCreatedThisInstance, locale, true); interp.exec(wr, this); // render and track events return interp.getEvents(); }
public void generateBuilder(SpecModel spec, Filer filer) throws IOException { ST st = templateGroup.getInstanceOf(SOURCE_TEMPLATE_NAME); st.add("spec", spec); JavaFileObject jfo = filer.createSourceFile(spec.getFullName(), spec.getInstantiator()); try(Writer w = jfo.openWriter()) { STWriter stWriter = new AutoIndentWriter(w); st.write(stWriter); } }
public List<InterpEvent> getEvents(Locale locale, int lineWidth) { StringWriter out = new StringWriter(); STWriter wr = new AutoIndentWriter(out); wr.setLineWidth(lineWidth); Interpreter interp = new Interpreter(groupThatCreatedThisInstance, locale, true); InstanceScope scope = new InstanceScope(null, this); interp.exec(wr, scope); // render and track events return interp.getEvents(); }
public List<InterpEvent> getEvents(Locale locale, int lineWidth) { StringWriter out = new StringWriter(); STWriter wr = new AutoIndentWriter(out); wr.setLineWidth(lineWidth); Interpreter interp = new Interpreter(groupThatCreatedThisInstance, locale, true); InstanceScope scope = new InstanceScope(null, this); interp.exec(wr, scope); // render and track events return interp.getEvents(); }
public List<InterpEvent> getEvents(Locale locale, int lineWidth) { StringWriter out = new StringWriter(); STWriter wr = new AutoIndentWriter(out); wr.setLineWidth(lineWidth); Interpreter interp = new Interpreter(groupThatCreatedThisInstance, locale, true); InstanceScope scope = new InstanceScope(null, this); interp.exec(wr, scope); // render and track events return interp.getEvents(); }
public List<InterpEvent> getEvents(Locale locale, int lineWidth) { StringWriter out = new StringWriter(); STWriter wr = new AutoIndentWriter(out); wr.setLineWidth(lineWidth); Interpreter interp = new Interpreter(groupThatCreatedThisInstance, locale, true); InstanceScope scope = new InstanceScope(null, this); interp.exec(wr, scope); // render and track events return interp.getEvents(); }
public List<InterpEvent> getEvents(Locale locale, int lineWidth) { StringWriter out = new StringWriter(); STWriter wr = new AutoIndentWriter(out); wr.setLineWidth(lineWidth); Interpreter interp = new Interpreter(groupThatCreatedThisInstance, locale, true); InstanceScope scope = new InstanceScope(null, this); interp.exec(wr, scope); // render and track events return interp.getEvents(); }
public List<InterpEvent> getEvents(Locale locale, int lineWidth) { StringWriter out = new StringWriter(); STWriter wr = new AutoIndentWriter(out); wr.setLineWidth(lineWidth); Interpreter interp = new Interpreter(groupThatCreatedThisInstance, locale, true); InstanceScope scope = new InstanceScope(null, this); interp.exec(wr, scope); // render and track events return interp.getEvents(); }
public List<InterpEvent> getEvents(Locale locale, int lineWidth) { StringWriter out = new StringWriter(); STWriter wr = new AutoIndentWriter(out); wr.setLineWidth(lineWidth); Interpreter interp = new Interpreter(groupThatCreatedThisInstance, locale, true); InstanceScope scope = new InstanceScope(null, this); interp.exec(wr, scope); // render and track events return interp.getEvents(); }