public final class VelocityMethods extends Object
A TORO utility class for Velocity related operations.
Apache Velocity is a Java-based template engine that provides a template language to reference objects defined in Java code. Makes it easy to parse Velocity templates.
Modifier and Type | Method and Description |
---|---|
static String |
parse(Map params,
Closure<Object> template) |
static String |
parse(String template)
Parse velocity Template.
|
static String |
parse(String template,
Closure<Map> params) |
static String |
parse(String template,
io.toro.gloop.engine.GloopExecutionContext context) |
static String |
parse(String template,
io.toro.gloop.object.property.GloopModel context,
io.toro.gloop.engine.GloopExecutionContext gloopExecutionContext) |
static String |
parse(String template,
Map<String,Object> params)
Parse velocity Template.
|
@GloopParameter(value="Evaluated velocity template") public static String parse(@GloopParameter(value="Velocity template",allowNull=false) String template, @GloopParameter(value="Velocity variables",allowNull=false) Map<String,Object> params)
Parse velocity Template. A variable called 'esb' of this class is added to the context
Example usage:
def context = ["firstname" : "James", "lastname" : "Greg"] println 'Hello $firstname $lastname'.parse( context );
template
- Velocity Templateparams
- The velocity context to replace the $public static String parse(String template)
Parse velocity Template. A variable called 'esb', which is an instance of this class is added to the context
Example usage:
'Hello world'.parse();
template
- Velocity Template@GloopParameter(value="Evaluated velocity template") @GloopComment(value="Evaluate a velocity template, using all the variables available in the current gloop context") public static String parse(@GloopParameter(value="Velocity template",allowNull=false) String template, io.toro.gloop.engine.GloopExecutionContext context)
@GloopParameter(value="Evaluated velocity template") @GloopComment(value="Evaluate a velocity template, using all the variables available in the mapped gloop modelVariables mapped belong in a model called context") public static String parse(@GloopParameter(value="Velocity template",allowNull=false) String template, @GloopParameter(allowExtraProperties=true) io.toro.gloop.object.property.GloopModel context, io.toro.gloop.engine.GloopExecutionContext gloopExecutionContext)
Copyright © 2019. All rights reserved.