Class AbstractJsTemplateCompiler

java.lang.Object
ro.isdc.wro.extensions.processor.support.template.AbstractJsTemplateCompiler
Direct Known Subclasses:
DustJs, HandlebarsJs, HoganJs

public abstract class AbstractJsTemplateCompiler extends Object
A base class for template processors like: dustJS or hoganJS.
Since:
1.4.7
Author:
Eivind Barstad Waaler
  • Constructor Details

    • AbstractJsTemplateCompiler

      public AbstractJsTemplateCompiler()
  • Method Details

    • compile

      public String compile(String content, String optionalArgument)
      Compiles the javascript template into plain javascript.
      Parameters:
      content - the template to be compiled.
      optionalArgument - any additional arguments used by template script.
      Returns:
      the compiled javascript.
    • getCompileCommand

      protected abstract String getCompileCommand()
      Returns:
      the js statement used to execute the compilation of the template.
    • getArguments

      protected String getArguments()
      Returns:
      additional arguments for the compiler.
    • getCompilerAsStream

      protected abstract InputStream getCompilerAsStream() throws IOException
      Returns:
      the stream of the compiler resource (javascript) used to compile templates.
      Throws:
      IOException - if the stream could not be located.