StringTemplateContent.java
package fr.sii.ogham.core.message.content;
import fr.sii.ogham.core.resource.path.ResolvedString;
import fr.sii.ogham.core.template.context.Context;
/**
* <p>
* Content that contains a template. The template contains variables. The
* template will be evaluated with the provided context (variable values).
* </p>
* This is a shortcut to:
* <pre>
* new TemplateContent("string:<template content>", context);
* </pre>
*
*
* @author Aurélien Baudet
*
*/
public class StringTemplateContent extends TemplateContent {
/**
* Initialize the content with the template and the context.
*
* @param template
* the template
* @param context
* the context (variable values)
*/
public StringTemplateContent(String template, Context context) {
super(new ResolvedString(template), context);
}
/**
* Shortcut for directly using any object as source for variable
* substitutions.
*
* @param template
* the template
* @param bean
* the object that contains the variable values
*/
public StringTemplateContent(String template, Object bean) {
super(new ResolvedString(template), bean);
}
}