Package org.apache.flex.forks.velocity

Examples of org.apache.flex.forks.velocity.Template.merge()


            velocityContext.put( "embedMap", embedMap );
          velocityContext.put( "embedProps", embedProps );

            StringWriter stringWriter = new StringWriter();

            template.merge(velocityContext, stringWriter);
            // once we figure out a non-AS2 way to call stop, add this and put the generated code in EmbedClass.vm
            //velocityContext.put("needsStop", "" + (data.defineTag instanceof DefineSprite && ((DefineSprite)data.defineTag).needsStop));

            //long t2 = System.currentTimeMillis();
            //VelocityManager.parseTime += t2 - start;
View Full Code Here


        {
            VelocityUtil velocityUtil = new VelocityUtil(TEMPLATE_PATH, configuration.debug(),
                                                         sourceCodeBuffer, lineNumberMap);
            VelocityContext velocityContext = VelocityManager.getCodeGenContext(velocityUtil);
            velocityContext.put(STYLE_MODULE_KEY, styleModule);
            template.merge(velocityContext, sourceCodeBuffer);
        }
        catch (Exception e)
        {
            ThreadLocalToolkit.log(new GenerateException(styleModule.getName(), e.getLocalizedMessage()));
            return null;
View Full Code Here

      VelocityContext vc = VelocityManager.getCodeGenContext(util);
      vc.put(DOC_KEY, doc);
      // pass whether to care for comments or not
      vc.put(COMMENTS_KEY, processComments);
   
            template.merge(vc, out);
    }
    catch (Exception e)
    {
      ThreadLocalToolkit.log(new CodeGenerationException(doc.getSourcePath(), e.getLocalizedMessage()));
      return null;
View Full Code Here

            velocityContext.put("needsSetActualSize", new Boolean(needsSetActualSize));
            velocityContext.put("needsName", new Boolean(!flexMovieClipOrSprite));
            velocityContext.put("needsToString", new Boolean(!flexMovieClipOrSprite));

            StringWriter stringWriter = new StringWriter();
            template.merge(velocityContext, stringWriter);
            result = stringWriter.toString();
        }
        catch (Exception e)
        {
            if (Trace.error)
View Full Code Here

                velocityContext.put("packageName", info.getPackageName());

                // run the template!
                //long s2 = System.currentTimeMillis();
                //VelocityManager.parseTime += s2 - start;
                template.merge(velocityContext, out);
                //VelocityManager.mergeTime += System.currentTimeMillis() - s2;

                // Normalize line endings as a temporary work around for bug 149821
                String generated = out.toString().replaceAll("\r\n", "\n");
                String filename = writeGenerated(info, generated);
View Full Code Here

                          + templateName + "'" );
            return false;
        }
        else
        {
            template.merge(context, writer);
            return true;
         }
    }

    /**
 
View Full Code Here

                          + templateName + "'" );
            return false;
        }
        else
        {
            template.merge(context, writer);
            return true;
         }
    }

    /**
 
View Full Code Here

                new FileOutputStream (
                    getFileName(RESULT_DIR, "encodingtest", RESULT_FILE_EXT));

            Writer writer = new BufferedWriter(new OutputStreamWriter(fos, "UTF-8"));
          
            template.merge(context, writer);
            writer.flush();
            writer.close();
           
            if (!isMatch(RESULT_DIR,COMPARE_DIR,"encodingtest",
                    RESULT_FILE_EXT,CMP_FILE_EXT) )
View Full Code Here

                new FileOutputStream (
                    getFileName(RESULT_DIR, "encodingtest2", RESULT_FILE_EXT));

            writer = new BufferedWriter(new OutputStreamWriter(fos, "UTF-8"));
          
            template.merge(context, writer);
            writer.flush();
            writer.close();
           
            if (!isMatch(RESULT_DIR,COMPARE_DIR,"encodingtest2",
                    RESULT_FILE_EXT,CMP_FILE_EXT) )
View Full Code Here

                new FileOutputStream (
                    getFileName(RESULT_DIR, "encodingtest3", RESULT_FILE_EXT));

            writer = new BufferedWriter(new OutputStreamWriter(fos, "GBK"));
          
            template.merge(context, writer);
            writer.flush();
            writer.close();
           
            if (!isMatch(RESULT_DIR,COMPARE_DIR,"encodingtest3",
                    RESULT_FILE_EXT,CMP_FILE_EXT) )
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.