title: Get annotations of bean in BeanPostProcessor implementation
body: <p>I'm trying to implement my own BeanPostProcessor implementation.</p>
  
  <pre><code>@Component
  public class UserDetailsProcessor implements BeanPostProcessor {
  
      @Override
      public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
          if (bean instanceof User) {
              User user = (User) bean;
              List&lt;Annotation&gt; beanAnnotations = Arrays.asList(user.getClass().getAnnotations());
              for (Annotation annotation : beanAnnotations) {
                  UserDetails userDetails = (UserDetails) annotation;
                  System.out.println(userDetails.firstName());
                  System.out.println(userDetails.lastName());
              }
          }
  
          return bean;
      }
  
      @Override
      public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
          return bean;
      }
  }
  </code></pre>
  
  <p>And this is my bean definition:</p>
  
  <pre><code>@SpringBootApplication
  public class HelloReactiveApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(HelloReactiveApplication.class, args);
      }
  
      @Bean
      @UserDetails(firstName = "Szymon", lastName = "Nowak")
      public User user() {
          return new User();
      }
  }
  </code></pre>
  
  <p>I'm trying to get annotations of bean, and proceed them somehow. I can clearly see why <code>user.getClass().getAnnotations()</code> not working, because it tries to get annotation from User class, and not annotations from bean definition. How can i get list of annotations on bean definition?</p>