当前位置: 首页>>代码示例>>Java>>正文


Java NoIndentWriter类代码示例

本文整理汇总了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();
}
 
开发者ID:bodar,项目名称:yatspec,代码行数:12,代码来源:WikiResultRenderer.java

示例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();
}
 
开发者ID:bodar,项目名称:yatspec,代码行数:30,代码来源:HtmlResultRenderer.java

示例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();
}
 
开发者ID:protostuff,项目名称:protostuff,代码行数:13,代码来源:ProtoToProtoCompiler.java

示例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;
}
 
开发者ID:protostuff,项目名称:protostuff,代码行数:16,代码来源:ProtoToJavaBeanModelCompiler.java

示例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;
}
 
开发者ID:protostuff,项目名称:protostuff,代码行数:16,代码来源:ProtoToJavaBeanModelCompiler.java


注:本文中的org.antlr.stringtemplate.NoIndentWriter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。