Class RestControllerBeanPostProcessor

java.lang.Object
com.bobocode.bring.web.servlet.bbp.RestControllerBeanPostProcessor
All Implemented Interfaces:
com.bobocode.bring.core.bpp.BeanPostProcessor

public class RestControllerBeanPostProcessor extends Object implements com.bobocode.bring.core.bpp.BeanPostProcessor
A BeanPostProcessor implementation that processes bean initialization annotated with @RestController.

This post-processor checks if the bean is annotated with @RestController and if it implements the BringServlet interface. If not, it throws a MissingBringServletImplException.

Since:
1.0
Author:
Blyzhnytsia Team
See Also:
  • Constructor Details

    • RestControllerBeanPostProcessor

      public RestControllerBeanPostProcessor()
  • Method Details

    • postProcessInitialization

      public Object postProcessInitialization(Object bean, String beanName)
      Processes bean initialization annotated with @RestController.
      Specified by:
      postProcessInitialization in interface com.bobocode.bring.core.bpp.BeanPostProcessor
      Parameters:
      bean - the bean instance
      beanName - the name of the bean
      Returns:
      the processed bean
      Throws:
      MissingBringServletImplException - if the bean is annotated with @RestController but does not implement the BringServlet interface