Package org.antlr.stringtemplate

Examples of org.antlr.stringtemplate.StringTemplateWriter


    void init(HttpServletRequest request, HttpServletResponse response, String newLine)
    throws ServletException, IOException
    {
        _request = request;
        _response = response;
        StringTemplateWriter wr = group.getStringTemplateWriter(response.getWriter());
        wr.setLineWidth(StringTemplateWriter.NO_WRAP);
        try
        {           
            write(wr);
        }
        catch (IOException io)
        {           
            error("Got IOException writing to writer "+wr.getClass().getName());
        }
        // reset so next toString() does not wrap; normally this is a new writer
        // each time, but just in case they override the group to reuse the
        // writer.
        //wr.setLineWidth(StringTemplateWriter.NO_WRAP);
View Full Code Here


                if ( renderer != null ) {
                    // you pay a penalty for applying format option to a template
                    // because the template must be written to a temp StringWriter so it can
                    // be formatted before being written to the real output.
                    StringWriter buf = new StringWriter();
                    StringTemplateWriter sw =
                        self.getGroup().getStringTemplateWriter(buf);
                    stToWrite.write(sw);
                    n = out.write(renderer.toString(buf.toString(), formatString));
                    return n;
                }
View Full Code Here

                // we get proper autowrap etc...
                // Ack: you pay a penalty now for a separator
                // Later, i can optimze to check if one chunk and
                // it's a conditional
                StringWriter buf = new StringWriter();
                StringTemplateWriter sw =
                    self.getGroup().getStringTemplateWriter(buf);
                int tmpsize = write(self, iterValue, sw);

                if ( tmpsize!=MISSING ) {
                    if ( seenAValue && separatorString!=null ) {
View Full Code Here

        }
        if ( expr instanceof StringTemplateAST ) {
      StringTemplateAST exprAST = (StringTemplateAST)expr;
      // must evaluate, writing to a string so we can hang on to it
            StringWriter buf = new StringWriter();
      StringTemplateWriter sw =
        self.getGroup().getStringTemplateWriter(buf);
       {
        ActionEvaluator eval =
            new ActionEvaluator(self,this,sw);
        try {
View Full Code Here

        _t = __t4;
        _t = _t.getNextSibling();
       
        StringWriter buf = new StringWriter();
        Class writerClass = out.getClass();
        StringTemplateWriter sw = null;
        try {
        Constructor ctor =
          writerClass.getConstructor(new Class[] {Writer.class});
        sw = (StringTemplateWriter)ctor.newInstance(new Object[] {buf});
        }
View Full Code Here

TOP

Related Classes of org.antlr.stringtemplate.StringTemplateWriter

Copyright © 2018 www.massapicom. 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.