Package org.apache.flex.forks.velocity

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


                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


        Template template = getTemplate(inputTemplate, inputEncoding != null ? inputEncoding : this.inputEncoding);
       
        if (outputFile == null || outputFile.equals(""))
        {
            StringWriter sw = new StringWriter();
            template.merge (controlContext,sw);
            return sw.toString();
        }
        else
        {
            Writer writer = null;
View Full Code Here

            {
                writer = (Writer) writers.get(outputFile);
            }               
           
            VelocityContext vc = new VelocityContext( controlContext );
            template.merge (vc,writer);

            // commented because it is closed in shutdown();
            //fw.close();
           
            return "";
View Full Code Here

        fillContextDefaults(this.controlContext);
        fillContextProperties(this.controlContext);

        Template template = getTemplate(controlTemplate, inputEncoding);
        StringWriter sw = new StringWriter();
        template.merge (controlContext,sw);
       
        return sw.toString();
    }

View Full Code Here

        Template template = getTemplate(inputTemplate, inputEncoding != null ? inputEncoding : this.inputEncoding);
       
        if (outputFile == null || outputFile.equals(""))
        {
            StringWriter sw = new StringWriter();
            template.merge (controlContext,sw);
            return sw.toString();
        }
        else
        {
            Writer writer = null;
View Full Code Here

            {
                writer = (Writer) writers.get(outputFile);
            }               
           
            VelocityContext vc = new VelocityContext( controlContext );
            template.merge (vc,writer);

            // commented because it is closed in shutdown();
            //fw.close();
           
            return "";
View Full Code Here

        fillContextDefaults(this.controlContext);
        fillContextProperties(this.controlContext);

        Template template = getTemplate(controlTemplate, inputEncoding);
        StringWriter sw = new StringWriter();
        template.merge (controlContext,sw);
       
        return sw.toString();
    }

View Full Code Here

        {
          Map.Entry entry = (Map.Entry)iter.next();
          velocityContext.put((String)entry.getKey(), entry.getValue());
        }

        template.merge(velocityContext, stringWriter);

        String sourceName = unit.getSource().getName();
        String prefix = sourceName.substring(0, sourceName.lastIndexOf(File.separatorChar) + 1);
        String generatedName = prefix + className + suffix;
View Full Code Here

    try
    {
      VelocityUtil util = new VelocityUtil(TEMPLATE_PATH, mxmlConfiguration.debug(), out, null);
      VelocityContext vc = VelocityManager.getCodeGenContext(util);
            vc.put(ATEMBEDS_KEY, atEmbeds);
      template.merge(vc, out);
    }
    catch (Exception e)
    {
      ThreadLocalToolkit.log(new VelocityException.GenerateException(compilationUnit.getSource().getRelativePath(),
                                                                           e.getLocalizedMessage()));
View Full Code Here

      VelocityUtil util = new VelocityUtil(TEMPLATE_PATH, mxmlConfiguration.debug(), out, null);
      VelocityContext vc = VelocityManager.getCodeGenContext(util);
      vc.put(STYLEDEFLIST_KEY, styleDefList);
            // vc.put(PACKAGENAME_KEY, packageName); TODO: get packagename working
      vc.put(CLASSNAME_KEY, className);
      template.merge(vc, out);
    }
    catch (Exception e)
    {
      ThreadLocalToolkit.log(new VelocityException.GenerateException(compilationUnit.getSource().getRelativePath(),
                                                                           e.getLocalizedMessage()));
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.