Class VelocityEngine
java.lang.Object
services.moleculer.web.template.AbstractTemplateEngine
services.moleculer.web.template.VelocityEngine
Server-side template engine based on Apache Velocity API. Required
dependency:
// https://mvnrepository.com/artifact/org.apache.velocity/velocity-engine-core compile group: 'org.apache.velocity', name: 'velocity-engine-core', version: '2.1'
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringCharset name.protected org.apache.velocity.app.VelocityEngineInternal Velocity instance.protected AtomicBooleanIs VelocityEngine inited?protected VelocityEngine.VelocityResourceLoaderResource loader.A list of template files containing macros to be used when merging.Fields inherited from class AbstractTemplateEngine
charset, defaultExtension, executor, messageLoader, reloadable, templatePath, writeBufferSize -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.velocity.app.VelocityEnginevoidsetApplicationAttribute(String key, Object value) voidsetCharset(Charset charset) voidsetDefaultExtension(String defaultExtension) voidsetEngine(org.apache.velocity.app.VelocityEngine engine) voidsetMacroLibraries(List<String> macroLibraries) voidsetProperties(String propsFilename) voidsetProperties(Properties configuration) voidsetProperty(String key, Object value) voidsetReloadable(boolean reloadable) voidsetTemplatePath(String templatePath) byte[]
-
Field Details
-
engine
protected org.apache.velocity.app.VelocityEngine engineInternal Velocity instance. -
macroLibraries
-
charsetName
Charset name. -
inited
Is VelocityEngine inited? -
loader
Resource loader.
-
-
Constructor Details
-
VelocityEngine
public VelocityEngine()
-
-
Method Details
-
transform
- Specified by:
transformin classAbstractTemplateEngine- Throws:
Exception
-
setCharset
- Overrides:
setCharsetin classAbstractTemplateEngine
-
setTemplatePath
- Overrides:
setTemplatePathin classAbstractTemplateEngine
-
setDefaultExtension
- Overrides:
setDefaultExtensionin classAbstractTemplateEngine
-
setReloadable
public void setReloadable(boolean reloadable) - Overrides:
setReloadablein classAbstractTemplateEngine
-
getEngine
public org.apache.velocity.app.VelocityEngine getEngine() -
setEngine
public void setEngine(org.apache.velocity.app.VelocityEngine engine) -
setProperty
-
setProperties
-
setProperties
-
setApplicationAttribute
-
getMacroLibraries
-
setMacroLibraries
-