本文整理汇总了Java中org.antlr.stringtemplate.NoIndentWriter类的典型用法代码示例。如果您正苦于以下问题:Java NoIndentWriter类的具体用法?Java NoIndentWriter怎么用?Java NoIndentWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NoIndentWriter类属于org.antlr.stringtemplate包,在下文中一共展示了NoIndentWriter类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: render
import org.antlr.stringtemplate.NoIndentWriter; //导入依赖的package包/类
public String render(Result result) throws Exception {
final EnhancedStringTemplateGroup group = new EnhancedStringTemplateGroup(getClass());
sequence(customRenderers).fold(group, registerRenderer());
group.registerRenderer(instanceOf(JavaSource.class), callable(new JavaSourceRenderer()));
group.registerRenderer(instanceOf(Notes.class), callable(new NotesRenderer()));
final StringTemplate template = group.getInstanceOf("wiki");
template.setAttribute("testResult", result);
StringWriter writer = new StringWriter();
template.write(new NoIndentWriter(writer));
return writer.toString();
}
示例2: render
import org.antlr.stringtemplate.NoIndentWriter; //导入依赖的package包/类
public String render(Result result) throws Exception {
final EnhancedStringTemplateGroup group = new EnhancedStringTemplateGroup(getClass());
group.registerRenderer(always().and(not(instanceOf(Number.class))), Xml.escape());
group.registerRenderer(instanceOf(ScenarioTableHeader.class), callable(new ScenarioTableHeaderRenderer()));
group.registerRenderer(instanceOf(JavaSource.class), callable(new JavaSourceRenderer()));
group.registerRenderer(instanceOf(Notes.class), callable(new NotesRenderer()));
group.registerRenderer(instanceOf(LinkingNote.class), callable(new LinkingNoteRenderer(result.getTestClass())));
group.registerRenderer(instanceOf(ContentAtUrl.class), asString());
sequence(customRenderers).fold(group, registerRenderer());
for (Class document : Creator.optionalClass("org.jdom.Document")) {
group.registerRenderer(instanceOf(document), callable(Creator.<Renderer>create(Class.forName("com.googlecode.yatspec.plugin.jdom.DocumentRenderer"))));
}
final StringTemplate template = group.getInstanceOf("yatspec");
template.setAttribute("script", loadContent("xregexp.js"));
template.setAttribute("script", loadContent("yatspec.js"));
for (Content customScript : customScripts) {
template.setAttribute("script", customScript);
}
for (Content customHeaderContent : customHeaderContents) {
template.setAttribute("customHeaderContent", customHeaderContent);
}
template.setAttribute("stylesheet", loadContent("yatspec.css"));
template.setAttribute("cssClass", getCssMap());
template.setAttribute("testResult", result);
StringWriter writer = new StringWriter();
template.write(new NoIndentWriter(writer));
return writer.toString();
}
示例3: extendBy
import org.antlr.stringtemplate.NoIndentWriter; //导入依赖的package包/类
public static String extendBy(StringTemplateGroup group, Message extend, Message by) throws IOException
{
StringWriter stringer = new StringWriter(16);
NoIndentWriter out = new NoIndentWriter(stringer);
StringTemplate messageBlock = group.getInstanceOf("extend_by");
messageBlock.setAttribute("message", extend);
messageBlock.setAttribute("by", by);
messageBlock.write(out);
return stringer.toString();
}
示例4: getRemoteModelName
import org.antlr.stringtemplate.NoIndentWriter; //导入依赖的package包/类
public String getRemoteModelName(StringTemplateGroup group, Message message) throws IOException
{
StringWriter writer = new StringWriter(16);
NoIndentWriter out = new NoIndentWriter(writer);
StringTemplate messageBlock = group.getInstanceOf("remote_model_name");
messageBlock.setAttribute("message", message);
messageBlock.setAttribute("name", message.getName());
messageBlock.write(out);
String result = writer.toString();
writer.close();
return result;
}
示例5: getRemoteModelSchemaName
import org.antlr.stringtemplate.NoIndentWriter; //导入依赖的package包/类
public String getRemoteModelSchemaName(StringTemplateGroup group, Message message) throws IOException
{
StringWriter writer = new StringWriter(16);
NoIndentWriter out = new NoIndentWriter(writer);
StringTemplate messageBlock = group.getInstanceOf("remote_model_schema_name");
messageBlock.setAttribute("message", message);
messageBlock.setAttribute("name", message.getName());
messageBlock.write(out);
String result = writer.toString();
writer.close();
return result;
}