Class ThymeleafAutoConfiguration
java.lang.Object
io.github.yvasyliev.forwarder.telegram.thymeleaf.ThymeleafAutoConfiguration
Auto-configuration class for setting up Thymeleaf integration in the Telegram Forwarder application.
This configuration provides beans for customizing the Thymeleaf template context and integrating a Telegram-specific
template engine.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiontelegramTemplateProcessor(org.thymeleaf.ITemplateEngine templateEngine) Creates aTelegramTemplateProcessorbean that processes Telegram templates using Thymeleaf.telegramTemplateProcessorInterceptor(List<TemplateContextCustomizer> contextCustomizers) Creates aTelegramTemplateProcessorInterceptorbean that applies the provided context customizers to the Thymeleaf template context.thymeleafEvaluationContextSetter(org.springframework.context.ApplicationContext applicationContext) Creates aTemplateContextCustomizerbean that sets up the Thymeleaf evaluation context.
-
Constructor Details
-
ThymeleafAutoConfiguration
public ThymeleafAutoConfiguration()
-
-
Method Details
-
thymeleafEvaluationContextSetter
@Bean @ConditionalOnMissingBean(name="thymeleafEvaluationContextSetter") public TemplateContextCustomizer thymeleafEvaluationContextSetter(org.springframework.context.ApplicationContext applicationContext) Creates aTemplateContextCustomizerbean that sets up the Thymeleaf evaluation context.- Parameters:
applicationContext- the Spring application context- Returns:
- a
TemplateContextCustomizerthat adds the Thymeleaf evaluation context to the template context
-
telegramTemplateProcessor
@Bean @ConditionalOnMissingBean public TelegramTemplateProcessor telegramTemplateProcessor(org.thymeleaf.ITemplateEngine templateEngine) Creates aTelegramTemplateProcessorbean that processes Telegram templates using Thymeleaf.- Parameters:
templateEngine- the Thymeleaf template engine- Returns:
- a new instance of
TelegramTemplateProcessor
-
telegramTemplateProcessorInterceptor
@Bean @ConditionalOnMissingBean public TelegramTemplateProcessorInterceptor telegramTemplateProcessorInterceptor(List<TemplateContextCustomizer> contextCustomizers) Creates aTelegramTemplateProcessorInterceptorbean that applies the provided context customizers to the Thymeleaf template context.- Parameters:
contextCustomizers- a list of context customizers to apply- Returns:
- a new instance of
TelegramTemplateProcessorInterceptor
-