public abstract class VelocityEngineUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static Log |
logger |
Constructor and Description |
---|
VelocityEngineUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
mergeTemplate(VelocityEngine velocityEngine,
java.lang.String templateLocation,
java.util.Map model,
java.io.Writer writer)
Merge the specified Velocity template with the given model and write
the result to the given Writer.
|
static void |
mergeTemplate(VelocityEngine velocityEngine,
java.lang.String templateLocation,
java.lang.String encoding,
java.util.Map model,
java.io.Writer writer)
Merge the specified Velocity template with the given model and write
the result to the given Writer.
|
static java.lang.String |
mergeTemplateIntoString(VelocityEngine velocityEngine,
java.lang.String templateLocation,
java.util.Map model)
Merge the specified Velocity template with the given model into a String.
|
static java.lang.String |
mergeTemplateIntoString(VelocityEngine velocityEngine,
java.lang.String templateLocation,
java.lang.String encoding,
java.util.Map model)
Merge the specified Velocity template with the given model into a String.
|
public static void mergeTemplate(VelocityEngine velocityEngine, java.lang.String templateLocation, java.util.Map model, java.io.Writer writer) throws VelocityException
velocityEngine
- VelocityEngine to work withtemplateLocation
- the location of template, relative to Velocity's
resource loader pathmodel
- the Map that contains model names as keys and model objects
as valueswriter
- the Writer to write the result toVelocityException
- if the template wasn't found or rendering failedpublic static void mergeTemplate(VelocityEngine velocityEngine, java.lang.String templateLocation, java.lang.String encoding, java.util.Map model, java.io.Writer writer) throws VelocityException
velocityEngine
- VelocityEngine to work withtemplateLocation
- the location of template, relative to Velocity's
resource loader pathencoding
- the encoding of the template filemodel
- the Map that contains model names as keys and model objects
as valueswriter
- the Writer to write the result toVelocityException
- if the template wasn't found or rendering failedpublic static java.lang.String mergeTemplateIntoString(VelocityEngine velocityEngine, java.lang.String templateLocation, java.util.Map model) throws VelocityException
When using this method to prepare a text for a mail to be sent with Spring's mail support, consider wrapping VelocityException in MailPreparationException.
velocityEngine
- VelocityEngine to work withtemplateLocation
- the location of template, relative to Velocity's
resource loader pathmodel
- the Map that contains model names as keys and model objects
as valuesVelocityException
- if the template wasn't found or rendering failedMailPreparationException
public static java.lang.String mergeTemplateIntoString(VelocityEngine velocityEngine, java.lang.String templateLocation, java.lang.String encoding, java.util.Map model) throws VelocityException
When using this method to prepare a text for a mail to be sent with Spring's mail support, consider wrapping VelocityException in MailPreparationException.
velocityEngine
- VelocityEngine to work withtemplateLocation
- the location of template, relative to Velocity's
resource loader pathencoding
- the encoding of the template filemodel
- the Map that contains model names as keys and model objects
as valuesVelocityException
- if the template wasn't found or rendering failedMailPreparationException