Ejemplo n.º 1
0
 public String getTemplateSource(boolean includeRoot) {
   if (null != templateResource) return templateResource.asTemplateContent();
   if (!includeRoot) return "";
   TemplateClass parent = root;
   while ((null != parent) && parent.isInner()) {
     parent = parent.root;
   }
   return null == parent ? "" : parent.getTemplateSource();
 }
Ejemplo n.º 2
0
 public void buildSourceCode() {
   long start = System.currentTimeMillis();
   addVersion();
   importPaths = new HashSet<String>();
   // Possible bug here?
   if (null != codeBuilder) codeBuilder.clear();
   if (null == dialect)
     codeBuilder =
         new CodeBuilder(
             templateResource.asTemplateContent(), name(), tagName(), this, engine, null);
   else
     codeBuilder =
         dialect.createCodeBuilder(
             templateResource.asTemplateContent(), name(), tagName(), this, engine);
   codeBuilder.build();
   extendedTemplateClass = codeBuilder.getExtendedTemplateClass();
   javaSource = codeBuilder.toString();
   if (logger.isTraceEnabled()) {
     logger.trace(
         "%s ms to generate java source for template: %s",
         System.currentTimeMillis() - start, getKey());
   }
 }