Module io.jstach.opt.spring.webflux
Package io.jstach.opt.spring.webflux
Class ViewSetupBeanPostProcessor
java.lang.Object
io.jstach.opt.spring.webflux.ViewSetupBeanPostProcessor
- All Implemented Interfaces:
org.springframework.beans.factory.config.BeanPostProcessor
public class ViewSetupBeanPostProcessor
extends Object
implements org.springframework.beans.factory.config.BeanPostProcessor
A
BeanPostProcessor
that it registers a HandlerResultHandler
that
automatically applies all JStachioModelViewConfigurer
instances to views before
rendering.-
Constructor Summary
ConstructorDescriptionViewSetupBeanPostProcessor
(org.springframework.context.ApplicationContext context) Constructor for Spring to inject the application context. -
Method Summary
Modifier and TypeMethodDescriptionpostProcessAfterInitialization
(Object bean, String beanName) Look for aViewResolutionResultHandler
and replace it with a wrapper that configuresJStachioModelView
instance using theJStachioModelViewConfigurer
s in the current context.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.config.BeanPostProcessor
postProcessBeforeInitialization
-
Constructor Details
-
ViewSetupBeanPostProcessor
Constructor for Spring to inject the application context.- Parameters:
context
- supplied by spring used to look forJStachioModelViewConfigurer
s.
-
-
Method Details
-
postProcessAfterInitialization
public Object postProcessAfterInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException Look for aViewResolutionResultHandler
and replace it with a wrapper that configuresJStachioModelView
instance using theJStachioModelViewConfigurer
s in the current context.- Specified by:
postProcessAfterInitialization
in interfaceorg.springframework.beans.factory.config.BeanPostProcessor
- Parameters:
bean
- the bean that is being createdbeanName
- the name of the bean- Returns:
- Object a bean wrapped with
ViewSetupBeanPostProcessor.ViewSetupResultHandler
if needed - Throws:
org.springframework.beans.BeansException
- in case of errors
-