Class FreemarkerEngine
java.lang.Object
ch.tocco.nice2.templating.impl.freemarker.FreemarkerEngine
- All Implemented Interfaces:
TemplateIdentifiers,TemplateEngine
@Component
public class FreemarkerEngine
extends Object
implements TemplateEngine, TemplateIdentifiers
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.tocco.nice2.templating.api.freemarker.directives.TemplateIdentifiers
TemplateIdentifiers.Scope -
Field Summary
Fields inherited from interface ch.tocco.nice2.templating.api.freemarker.directives.TemplateIdentifiers
BASEDATA_VAR, DELIMITER_PARAM, ENTITY_PARAM, INLINE_TEMPLATE, KEY, LIMIT_PARAM, LINE_END_PARAM, LINE_START_PARAM, NAME_PARAM, PATH_PARAM, PATHS_PARAM, PATTERN_PARAM, RECIPIENT_VAR, SCOPE_PARAM, SENDER_VAR, SINGLE_BASE_VAR, TARGET_VAR, VALUE_PARAM -
Constructor Summary
ConstructorsConstructorDescriptionFreemarkerEngine(org.slf4j.Logger log, L10N l10N, TimezoneResolverService timezoneService, FreemarkerTemplateModelService freemarkerTemplateModelService, freemarker.template.ObjectWrapper ObjectWrapper) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidprocess(Nice2Template nice2Template) Process the template.voidsetTemplateLoaders(List<TemplateLoaderContribution> templateLoaders) voidsetTemplateModelProviders(List<TemplateModelProvider> providers) com.google.common.io.FileBackedOutputStreamstream(Nice2Template nice2Template) stream the output of a processed Nice2Template into a new FileBackedOutputStreamvoidstream(Nice2Template nice2Template, OutputStream stream) Stream the output of a processed Nice2Template into a provided OutputStream
-
Constructor Details
-
FreemarkerEngine
public FreemarkerEngine(org.slf4j.Logger log, L10N l10N, TimezoneResolverService timezoneService, @Lazy FreemarkerTemplateModelService freemarkerTemplateModelService, @Lazy freemarker.template.ObjectWrapper ObjectWrapper)
-
-
Method Details
-
setTemplateModelProviders
-
setTemplateLoaders
@Autowired(required=false) public void setTemplateLoaders(List<TemplateLoaderContribution> templateLoaders) -
stream
public com.google.common.io.FileBackedOutputStream stream(Nice2Template nice2Template) throws TemplateException Description copied from interface:TemplateEnginestream the output of a processed Nice2Template into a new FileBackedOutputStream- Specified by:
streamin interfaceTemplateEngine- Parameters:
nice2Template- a fully configured Nice2Template- Throws:
TemplateException
-
stream
Description copied from interface:TemplateEngineStream the output of a processed Nice2Template into a provided OutputStream- Specified by:
streamin interfaceTemplateEngine- Parameters:
nice2Template- a fully configured Nice2Templatestream- an OutputStream to write to- Throws:
TemplateException
-
process
Process the template.- Specified by:
processin interfaceTemplateEngine- Parameters:
nice2Template- a fully configured Nice2Template- Returns:
- a filled template
- Throws:
TemplateException- -
-
createTemplate
- Specified by:
createTemplatein interfaceTemplateEngine- Returns:
- create a new Template for the Template Engine
-
initializeService
@PostConstruct public void initializeService() -
initConfiguration
public void initConfiguration()
-