From 8fd8a9b6184555b26e58548190ab74de46aa3dce Mon Sep 17 00:00:00 2001 From: Madhura Bhave Date: Fri, 12 Apr 2019 11:55:06 -0700 Subject: [PATCH] Fix javadoc --- .../ConditionalOnMissingFilterBean.java | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/ConditionalOnMissingFilterBean.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/ConditionalOnMissingFilterBean.java index 81c8334f8d..f48265e98f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/ConditionalOnMissingFilterBean.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/ConditionalOnMissingFilterBean.java @@ -33,11 +33,28 @@ import org.springframework.core.annotation.AliasFor; /** * {@link Conditional} that only matches when no {@link Filter} beans of the specified * type are contained in the {@link BeanFactory}. This condition will detect both directly - * register {@link Filter} beans as well as those registered via a + * registered {@link Filter} beans as well as those registered via a * {@link FilterRegistrationBean}. *

* When placed on a {@code @Bean} method, the bean class defaults to the return type of - * the factory method: + * the factory method or the type of the {@link Filter} if the bean is a + * {@link FilterRegistrationBean}: + * + *

+ * @Configuration
+ * public class MyAutoConfiguration {
+ *
+ *     @ConditionalOnMissingFilterBean
+ *     @Bean
+ *     public MyFilter myFilter() {
+ *         ...
+ *     }
+ *
+ * }
+ *

+ * In the sample above the condition will match if no bean of type {@code MyFilter} or + * {@code FilterRegistrationBean} is already contained in the + * {@link BeanFactory}. * * @author Phillip Webb * @since 2.1.0