Class AxelorStreamingTemplateEngine

java.lang.Object
groovy.text.TemplateEngine
groovy.text.StreamingTemplateEngine
com.axelor.text.AxelorStreamingTemplateEngine

public class AxelorStreamingTemplateEngine extends groovy.text.StreamingTemplateEngine
StreamingTemplateEngine implementation that allows to pass CompilerConfiguration.

This allows to apply custom script transformation (for scripting policy).

Also keep default of not reusing class loader so that each script class can individually be garbage collected.

  • Field Details

    • TEMPLATE_SCRIPT_PREFIX

      protected static final String TEMPLATE_SCRIPT_PREFIX
      See Also:
    • COUNTER

      protected static final AtomicInteger COUNTER
    • REUSE_CLASS_LOADER

      protected static final boolean REUSE_CLASS_LOADER
    • parentLoader

      protected final ClassLoader parentLoader
    • config

      protected final org.codehaus.groovy.control.CompilerConfiguration config
  • Constructor Details

    • AxelorStreamingTemplateEngine

      public AxelorStreamingTemplateEngine(ClassLoader parentLoader, org.codehaus.groovy.control.CompilerConfiguration config)
      Creates a StreamingTemplateEngine with the given parent class loader and compiler configuration.
      Parameters:
      parentLoader -
      config -
  • Method Details