Package org.apache.velocity.script
Class VelocityScriptEngineFactory
java.lang.Object
org.apache.velocity.script.VelocityScriptEngineFactory
- All Implemented Interfaces:
ScriptEngineFactory
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget engine nameget engine versionget the list of file extensions handled by Velocity: vm, vtl, vhtmlget language nameget language version (same as engine version)getMethodCallSyntax(String obj, String m, String... args) get Velocity syntax for calling method 'm' on object 'obj' with provided argumentsget the list of Velocity mime typesgetNames()get the list of namesgetOutputStatement(String toDisplay) get VTL expression used to display specified stringgetParameter(String key) get engine parameter for provided keygetProgram(String... statements) get whole VTL program given VTL linesget a Velocity script engine
-
Constructor Details
-
VelocityScriptEngineFactory
public VelocityScriptEngineFactory()
-
-
Method Details
-
getEngineName
get engine name- Specified by:
getEngineNamein interfaceScriptEngineFactory- Returns:
- engine name, aka "Velocity"
-
getEngineVersion
get engine version- Specified by:
getEngineVersionin interfaceScriptEngineFactory- Returns:
- engine version string
-
getExtensions
get the list of file extensions handled by Velocity: vm, vtl, vhtml- Specified by:
getExtensionsin interfaceScriptEngineFactory- Returns:
- extensions list
-
getLanguageName
get language name- Specified by:
getLanguageNamein interfaceScriptEngineFactory- Returns:
- language name, aka "VTL"
-
getLanguageVersion
get language version (same as engine version)- Specified by:
getLanguageVersionin interfaceScriptEngineFactory- Returns:
- language version string
-
getMethodCallSyntax
get Velocity syntax for calling method 'm' on object 'obj' with provided arguments- Specified by:
getMethodCallSyntaxin interfaceScriptEngineFactory- Parameters:
obj-m-args-- Returns:
- VTL call ${obj.m(args...)}
-
getMimeTypes
get the list of Velocity mime types- Specified by:
getMimeTypesin interfaceScriptEngineFactory- Returns:
- singleton { 'text/x-velocity' }
-
getNames
get the list of names- Specified by:
getNamesin interfaceScriptEngineFactory- Returns:
- { 'velocity', 'Velocity' }
-
getOutputStatement
get VTL expression used to display specified string- Specified by:
getOutputStatementin interfaceScriptEngineFactory- Parameters:
toDisplay-- Returns:
- escaped string #[[toDisplay]]#
-
getParameter
get engine parameter for provided key- Specified by:
getParameterin interfaceScriptEngineFactory- Parameters:
key-- Returns:
- found parameter, or null
-
getProgram
get whole VTL program given VTL lines- Specified by:
getProgramin interfaceScriptEngineFactory- Parameters:
statements- VTL lines- Returns:
- lines concatenated with carriage returns
-
getScriptEngine
get a Velocity script engine- Specified by:
getScriptEnginein interfaceScriptEngineFactory- Returns:
- a new Velocity script engine
-