diff --git a/spring-context/src/main/java/org/springframework/context/annotation/Conditional.java b/spring-context/src/main/java/org/springframework/context/annotation/Conditional.java index 9807e298f6..f47aecf174 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/Conditional.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/Conditional.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ import java.lang.annotation.Target; /** * Indicates that a component is only eligible for registration when all - * {@linkplain #value() specified conditions} match. + * {@linkplain #value specified conditions} match. * *

A condition is any state that can be determined programmatically * before the bean definition is due to be registered (see {@link Condition} for details). @@ -37,14 +37,21 @@ import java.lang.annotation.Target; *

  • as a method-level annotation on any {@link Bean @Bean} method
  • * * - *

    If a {@code @Configuration} class is marked with {@code @Conditional}, all of the - * {@code @Bean} methods, {@link Import @Import} and {@link ComponentScan @ComponentScan} - * annotations associated with that class will be subject to the conditions. + *

    If a {@code @Configuration} class is marked with {@code @Conditional}, + * all of the {@code @Bean} methods, {@link Import @Import} annotations, and + * {@link ComponentScan @ComponentScan} annotations associated with that + * class will be subject to the conditions. * - *

    NOTE: {@code @Conditional} annotations are not inherited; any conditions from - * superclasses or from overridden methods are not being considered. + *

    NOTE: Inheritance of {@code @Conditional} annotations + * is not supported; any conditions from superclasses or from overridden + * methods will not be considered. In order to enforce these semantics, + * {@code @Conditional} itself is not declared as + * {@link java.lang.annotation.Inherited @Inherited}; furthermore, any + * custom composed annotation that is meta-annotated with + * {@code @Conditional} must not be declared as {@code @Inherited}. * * @author Phillip Webb + * @author Sam Brannen * @since 4.0 * @see Condition */