Package com.axelor.text
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 Summary
FieldsModifier and TypeFieldDescriptionprotected final org.codehaus.groovy.control.CompilerConfiguration
protected static final AtomicInteger
protected final ClassLoader
protected static final boolean
protected static final String
-
Constructor Summary
ConstructorsConstructorDescriptionAxelorStreamingTemplateEngine
(ClassLoader parentLoader, org.codehaus.groovy.control.CompilerConfiguration config) Creates a StreamingTemplateEngine with the given parent class loader and compiler configuration. -
Method Summary
Methods inherited from class groovy.text.TemplateEngine
createTemplate, createTemplate, createTemplate, createTemplate, createTemplate
-
Field Details
-
TEMPLATE_SCRIPT_PREFIX
- See Also:
-
COUNTER
-
REUSE_CLASS_LOADER
protected static final boolean REUSE_CLASS_LOADER -
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
-
createTemplate
public groovy.text.Template createTemplate(Reader reader) throws org.codehaus.groovy.control.CompilationFailedException, ClassNotFoundException, IOException - Overrides:
createTemplate
in classgroovy.text.StreamingTemplateEngine
- Throws:
org.codehaus.groovy.control.CompilationFailedException
ClassNotFoundException
IOException
-