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
ConstructorsConstructorDescriptionViewSetupBeanPostProcessor(org.springframework.context.ApplicationContext context) Constructor for Spring to inject the application context. -
Method Summary
Modifier and TypeMethodDescriptionpostProcessAfterInitialization(Object bean, String beanName) Look for aViewResolutionResultHandlerand replace it with a wrapper that configuresJStachioModelViewinstance using theJStachioModelViewConfigurers in the current context.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 forJStachioModelViewConfigurers.
-
-
Method Details
-
postProcessAfterInitialization
public Object postProcessAfterInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException Look for aViewResolutionResultHandlerand replace it with a wrapper that configuresJStachioModelViewinstance using theJStachioModelViewConfigurers in the current context.- Specified by:
postProcessAfterInitializationin 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.ViewSetupResultHandlerif needed - Throws:
org.springframework.beans.BeansException- in case of errors
-