Examples of AutoIndentWriter


Examples of org.antlr.stringtemplate.AutoIndentWriter

        // getResourceAsInputStream also considers the content cache
        String text = exchange.getContext().getTypeConverter().mandatoryConvertTo(String.class, getResourceAsInputStream());
        StringTemplate template = new StringTemplate(text);
        template.setAttributes(variableMap);
        log.debug("StringTemplate is writing using attributes: {}", variableMap);
        template.write(new AutoIndentWriter(buffer));

        // now lets output the results to the exchange
        Message out = exchange.getOut();
        out.setBody(buffer.toString());
        out.setHeaders(exchange.getIn().getHeaders());
View Full Code Here

Examples of org.antlr.stringtemplate.AutoIndentWriter

   
    public static void compileEnumBlockTo(Writer writer,
            ProtoModule module, EnumGroup eg,
            StringTemplate enumBlockTemplate) throws IOException
    {
        AutoIndentWriter out = new AutoIndentWriter(writer);
       
        StringTemplate enumBlock = enumBlockTemplate.getInstanceOf();
        enumBlock.setAttribute("eg", eg);
        enumBlock.setAttribute("module", module);
        enumBlock.setAttribute("options", module.getOptions());
View Full Code Here

Examples of org.antlr.stringtemplate.AutoIndentWriter

   
    public static void compileMessageBlockTo(Writer writer,
            ProtoModule module, Message message,
            StringTemplate messageBlockTemplate) throws IOException
    {
        AutoIndentWriter out = new AutoIndentWriter(writer);
       
        StringTemplate messageBlock = messageBlockTemplate.getInstanceOf();
        messageBlock.setAttribute("message", message);
        messageBlock.setAttribute("module", module);
        messageBlock.setAttribute("options", module.getOptions());
View Full Code Here

Examples of org.antlr.stringtemplate.AutoIndentWriter

            fileName = resolveFileName(name);
        }
       
        Writer writer = CompilerUtil.newWriter(module, packageName, fileName);
       
        AutoIndentWriter out = new AutoIndentWriter(writer);
       
        StringTemplate protoBlock = protoBlockTemplate.getInstanceOf();
        protoBlock.setAttribute("proto", proto);
        protoBlock.setAttribute("module", module);
        protoBlock.setAttribute("options", module.getOptions());
View Full Code Here

Examples of org.antlr.stringtemplate.AutoIndentWriter

        // getResourceAsInputStream also considers the content cache
        String text = exchange.getContext().getTypeConverter().mandatoryConvertTo(String.class, getResourceAsInputStream());
        StringTemplate template = new StringTemplate(text);
        template.setAttributes(variableMap);
        log.debug("StringTemplate is writing using attributes: {}", variableMap);
        template.write(new AutoIndentWriter(buffer));

        // now lets output the results to the exchange
        Message out = exchange.getOut();
        out.setBody(buffer.toString());
        out.setHeader(StringTemplateConstants.STRINGTEMPLATE_RESOURCE, getResource());
View Full Code Here

Examples of org.antlr.stringtemplate.AutoIndentWriter

        // getResourceAsInputStream also considers the content cache
        String text = exchange.getContext().getTypeConverter().mandatoryConvertTo(String.class, getResourceAsInputStream());
        StringTemplate template = new StringTemplate(text);
        template.setAttributes(variableMap);
        log.debug("StringTemplate is writing using attributes: {}", variableMap);
        template.write(new AutoIndentWriter(buffer));

        // now lets output the results to the exchange
        Message out = exchange.getOut();
        out.setBody(buffer.toString());
        out.setHeader(StringTemplateConstants.STRINGTEMPLATE_RESOURCE_URI, getResourceUri());
View Full Code Here

Examples of org.antlr.stringtemplate.AutoIndentWriter

        StringTemplate template = new StringTemplate(text);
        template.setAttributes(variableMap);
        if (log.isDebugEnabled()) {
            log.debug("StringTemplate is writing using attributes: " + variableMap);
        }
        template.write(new AutoIndentWriter(buffer));

        // now lets output the results to the exchange
        Message out = exchange.getOut();
        out.setBody(buffer.toString());
        out.setHeaders(exchange.getIn().getHeaders());
View Full Code Here

Examples of org.antlr.stringtemplate.AutoIndentWriter

            for(EnumGroup eg : proto.getEnumGroups())
            {
                String fileName = eg.getName() + fileExtension;
               
                Writer writer = CompilerUtil.newWriter(module, packageName, fileName);
                AutoIndentWriter out = new AutoIndentWriter(writer);
               
                StringTemplate enumBlock = group.getInstanceOf("enum_block");
                enumBlock.setAttribute("eg", eg);
                enumBlock.setAttribute("module", module);
                enumBlock.setAttribute("options", module.getOptions());

                enumBlock.write(out);
                writer.close();
            }
        }

        if(hasMessageBlock)
        {
            for(Message m : proto.getMessages())
            {
                String fileName = m.getName() + fileExtension;
               
                Writer writer = CompilerUtil.newWriter(module, packageName, fileName);
                AutoIndentWriter out = new AutoIndentWriter(writer);
               
                StringTemplate messageBlock = group.getInstanceOf("message_block");
                messageBlock.setAttribute("message", m);
                messageBlock.setAttribute("module", module);
                messageBlock.setAttribute("options", module.getOptions());
View Full Code Here

Examples of org.antlr.stringtemplate.AutoIndentWriter

       
        String fileName = name + fileExtension;
       
        Writer writer = CompilerUtil.newWriter(module, packageName, fileName);
       
        AutoIndentWriter out = new AutoIndentWriter(writer);
        StringTemplate protoOuterBlock = group.getInstanceOf("proto_block");
       
        protoOuterBlock.setAttribute("proto", proto);
        protoOuterBlock.setAttribute("module", module);
        protoOuterBlock.setAttribute("options", module.getOptions());
View Full Code Here

Examples of org.antlr.stringtemplate.AutoIndentWriter

        StringTemplate template = new StringTemplate(text);
        template.setAttributes(variableMap);
        if (log.isDebugEnabled()) {
            log.debug("StringTemplate is writing using attributes: " + variableMap);
        }
        template.write(new AutoIndentWriter(buffer));

        // now lets output the results to the exchange
        Message out = exchange.getOut(true);
        out.setBody(buffer.toString());
        out.setHeader(StringTemplateConstants.STRINGTEMPLATE_RESOURCE, getResource());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.