Package com.axelor.text
Class AxelorGStringTemplateEngine
java.lang.Object
groovy.text.TemplateEngine
groovy.text.GStringTemplateEngine
com.axelor.text.AxelorGStringTemplateEngine
public class AxelorGStringTemplateEngine
extends groovy.text.GStringTemplateEngine
GStringTemplateEngine 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 AtomicInteger
protected final ClassLoader
protected static final boolean
-
Constructor Summary
ConstructorsConstructorDescriptionAxelorGStringTemplateEngine
(ClassLoader parentLoader, org.codehaus.groovy.control.CompilerConfiguration config) Creates a GStringTemplateEngine 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
-
parentLoader
-
config
protected final org.codehaus.groovy.control.CompilerConfiguration config -
counter
-
REUSE_CLASS_LOADER
protected static final boolean REUSE_CLASS_LOADER
-
-
Constructor Details
-
AxelorGStringTemplateEngine
public AxelorGStringTemplateEngine(ClassLoader parentLoader, org.codehaus.groovy.control.CompilerConfiguration config) Creates a GStringTemplateEngine 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.GStringTemplateEngine
- Throws:
org.codehaus.groovy.control.CompilationFailedException
ClassNotFoundException
IOException
-