Package cn.bran.japid.template

Examples of cn.bran.japid.template.JapidTemplate


   * @throws Exception
   */
  public File generate(String fileName) throws Exception {
    String realSrcFile = sourceFolder == null ? fileName : sourceFolder + "/" + fileName;
    String src = readFileAsString(realSrcFile);
    JapidTemplate temp = new JapidTemplate(fileName, src);
    JapidAbstractCompiler c = null;
    // TODO: more robust way of determine layout file or view file
    if (looksLikeLayout(src)) {
      c = new JapidLayoutCompiler();
    } else {
View Full Code Here


        // compile the target and include the layout part in the current output flow
        String target = parseInclude(line);
        String src;
        try {
          src = DirUtil.readFileAsString(target);
          JapidTemplate template = new JapidTemplate(target, src);
          JapidAbstractCompiler c = JapidTemplateTransformer.selectCompiler(src);
          c.setUseWithPlay(getTemplateClassMetaData().useWithPlay);
          c.compile(template);
          String jsrc = template.javaSource;
          getTemplateClassMetaData().merge(c.getTemplateClassMetaData());
View Full Code Here

   * @throws Exception
   */
  public File generate(String fileName) throws Exception {
    String realSrcFile = sourceFolder == null ? fileName : sourceFolder + "/" + fileName;
    String src = DirUtil.readFileAsString(realSrcFile);
    JapidTemplate temp = new JapidTemplate(fileName, src);
    JapidAbstractCompiler c = selectCompiler(src);
    c.setUseWithPlay(usePlay);
    c.compile(temp);
    String jsrc = temp.javaSource;

View Full Code Here

   * @param fqName
   * @param mime
   * @return
   */
  public static String generateInMemory(String scriptSrc,  String fqName, MimeTypeEnum mime, boolean usePlay) {
    JapidTemplate temp = new JapidTemplate(fqName, mime, scriptSrc);
    return compileJapid(scriptSrc, usePlay, temp);
  }
View Full Code Here

   * @param srcFileName the full path to the script file. Used to parse package and class name
   * @return the generated Java code
   *
   */
  public static String generateInMemory(String scriptSrc,  String srcFileName, boolean usePlay) {
    JapidTemplate temp = new JapidTemplate(srcFileName, scriptSrc);
    return compileJapid(scriptSrc, usePlay, temp);
  }
View Full Code Here

TOP

Related Classes of cn.bran.japid.template.JapidTemplate

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.