| Constructor and Description |
|---|
VelocityMethods(org.apache.velocity.app.VelocityEngine esbVelocityEngine) |
| Modifier and Type | Method and Description |
|---|---|
static String |
parse(Map params,
groovy.lang.Closure<Object> template)
Parses a Velocity template.
|
static String |
parse(String template)
Parses a Velocity template.
|
static String |
parse(String template,
groovy.lang.Closure<Map> params)
Parses a Velocity template.
|
static String |
parse(String template,
GloopExecutionContext context)
Parses a Velocity template, using all the variables available in the current Gloop context.
|
static String |
parse(String template,
GloopModel context,
GloopExecutionContext gloopExecutionContext)
Parses a Velocity template, using all the variables available
in the current Gloop context, and provided context.
|
static String |
parse(String template,
Map<String,Object> params)
Parses a Velocity template.
|
@Autowired VelocityMethods(org.apache.velocity.app.VelocityEngine esbVelocityEngine)
public static String parse(@GloopParameter(allowNull=false) String template, @GloopParameter(allowNull=false) Map<String,Object> params)
Parses a Velocity template.
Example usage:
def context = [ "firstname": "James", "lastname": "Greg" ] def template = 'Hello, $firstname $lastname.' def parsedTemplate = template.parse( context ); assert parsedTemplate.equals( 'Hello, James Greg.' )
A variable called esb is added to the context as well,
which can be used to call one-liners from GroovyMethods.
template - the template to parseparams - the context, which contains values which will be mapped to variables used in the templatepublic static String parse(String template)
Parses a Velocity template.
Example usage:
def template = 'Hello, world.' def parsedTemplate = template.parse(); assert parsedTemplate.equals( 'Hello, world.' )
template - the template to parsepublic static String parse(Map params, groovy.lang.Closure<Object> template)
Parses a Velocity template.
Example usage:
def context = [ "firstname": "James", "lastname": "Greg" ]
def template = { 'Hello, $firstname $lastname.' }
def parsedTemplate = context.parse( template );
assert parsedTemplate.equals( 'Hello, James Greg.' )
A variable called esb is added to the context as well,
which can be used to call one-liners from GroovyMethods.
params - the context, which contains values which will be mapped to variables used in the templatetemplate - a closure returning the template to parsepublic static String parse(String template, groovy.lang.Closure<Map> params)
Parses a Velocity template.
Example usage:
def context = [ "firstname": "James", "lastname": "Greg" ] def template = 'Hello, $firstname $lastname.' def parsedTemplate = context.parse( template ); assert parsedTemplate.equals( 'Hello, James Greg.' )
A variable called esb is added to the context as well,
which can be used to call one-liners from GroovyMethods.
template - the template to parseparams - the context, which contains values which will be mapped to variables used in the templatepublic static String parse(@GloopParameter(allowNull=false) String template, GloopExecutionContext context)
Parses a Velocity template, using all the variables available in the current Gloop context.
template - the template to parsecontext - the Gloop execution context (automatically mapped by Gloop),
from which the template context will be derived;
the context contains values which will be mapped to variables used in the templatepublic static String parse(@GloopParameter(allowNull=false) String template, GloopModel context, GloopExecutionContext gloopExecutionContext)
Parses a Velocity template, using all the variables available in the current Gloop context, and provided context.
template - the template to parsecontext - the context, which contains values which will be mapped to variables used in the templategloopExecutionContext - the Gloop execution context (automatically mapped by Gloop),
from which the template context will be derived;
the context contains values which will be mapped to variables used in the templateCopyright © 2021. All rights reserved.