Package net.sf.laja.template

Examples of net.sf.laja.template.Template


   * @param itemplate
   * @param imacrobody
   * @return
   */
  private Context getContext(ITemplate itemplate, IMacro imacro, IFunction ifunction) {
    Template template = (Template) itemplate;
    if (imacro != null) {
      return ((Macro) imacro).getLocalContext();
    }
    if (ifunction != null) {
      return ((Macro) ifunction).getLocalContext();
    }
    return template.getContext();
  }
View Full Code Here


  }

  @Override
  public ITemplate createTemplate() {
    if (baseTemplate != null) {
      return new Template(new ImportedFiles(), namespaces, templateTextWriter, source, classes, groovyClassLoader);
    }
    baseTemplate = new Template(new ImportedFiles(), namespaces, templateTextWriter, source, classes, groovyClassLoader);

    return baseTemplate;
  }
View Full Code Here

    return new Write(source, templateTextWriter);
  }

  @Override
  public ISet createSet(ITemplate itemplate, IMacro imacro) {
    Template template = (Template) itemplate;
    return new Set(source, namespaces, templateTextWriter, (Macro) imacro, template.getContext());
  }
View Full Code Here

    return new Else();
  }

  @Override
  public IForeach createForeach(ITemplate itemplate) {
    Template template = (Template) itemplate;
    return new Foreach(source, template.getContext());
  }
View Full Code Here

    return new Foreach(source, template.getContext());
  }

  @Override
  public IImportcmd createImportcmd(ITemplate itemplate) {
    Template template = (Template) itemplate;
    StringExp filename = new StringExp();
    filename.addText(source.getName());
    return new Importcmd(new ImportedFiles(filename), templateTextWriter, source, namespaces, classes, template.getContext(), groovyClassLoader);
  }
View Full Code Here

    return new Importcmd(new ImportedFiles(filename), templateTextWriter, source, namespaces, classes, template.getContext(), groovyClassLoader);
  }

  @Override
  public IMacro createMacro(ITemplate itemplate) {
    Template template = (Template) itemplate;
    return new Macro(false, source, namespaces, templateTextWriter, template.getContext());
  }
View Full Code Here

    return new Operator();
  }

  @Override
  public ICall createCall(ITemplate itemplate) {
    Template template = (Template) itemplate;
    return new Call(source, template.getContext(), namespaces, templateTextWriter);
  }
View Full Code Here

    return new NewStatement(classes);
  }

  @Override
  public IFunction createFunction(ITemplate itemplate) {
    Template template = (Template) itemplate;
    return new Macro(true, source, namespaces, templateTextWriter, template.getContext());
  }
View Full Code Here

    }
  }

  private void generateTemplate(InargsParser inargsParser) {
    for (GenerateCommand generateCommand : inargsParser.getGenerateCommands()) {
      Template template = generateCommand.parseTemplate(settings.getSystemImportsFilename());

      for (PrepareGenerateCommand prepareGenerateCommand : inargsParser.getPrepareGenerateCommands()) {
        prepareGenerateCommand.execute(template);
      }
      template.generate();
    }
  }
View Full Code Here

  }

  // Yes, this is code duplication, but this code is only used for debugging purpose and we don't want to mess up the method generateTemplate.
  private void printTemplate(InargsParser inargsParser) {
    for (GenerateCommand generateCommand : inargsParser.getGenerateCommands()) {
      Template template = generateCommand.parseTemplate(settings.getSystemImportsFilename());

      for (PrepareGenerateCommand prepareGenerateCommand : inargsParser.getPrepareGenerateCommands()) {
        prepareGenerateCommand.execute(template);
      }
      template.print(new SyntaxTextPrinter());
    }
  }
View Full Code Here

TOP

Related Classes of net.sf.laja.template.Template

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.