|
|
|
@ -76,6 +76,10 @@ public @interface ComponentScan { |
|
|
|
* <p>Allows for more concise annotation declarations if no other attributes |
|
|
|
* <p>Allows for more concise annotation declarations if no other attributes |
|
|
|
* are needed — for example, {@code @ComponentScan("org.my.pkg")} |
|
|
|
* are needed — for example, {@code @ComponentScan("org.my.pkg")} |
|
|
|
* instead of {@code @ComponentScan(basePackages = "org.my.pkg")}. |
|
|
|
* instead of {@code @ComponentScan(basePackages = "org.my.pkg")}. |
|
|
|
|
|
|
|
* <p>This attribute has the same semantics as {@link #basePackages}, including |
|
|
|
|
|
|
|
* support for {@code ${...}} placeholders (resolved against the |
|
|
|
|
|
|
|
* {@link org.springframework.core.env.Environment Environment}) and |
|
|
|
|
|
|
|
* Ant-style package patterns (for example, {@code com.example.**}). |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@AliasFor("basePackages") |
|
|
|
@AliasFor("basePackages") |
|
|
|
String[] value() default {}; |
|
|
|
String[] value() default {}; |
|
|
|
@ -86,6 +90,13 @@ public @interface ComponentScan { |
|
|
|
* attribute. |
|
|
|
* attribute. |
|
|
|
* <p>Use {@link #basePackageClasses} for a type-safe alternative to |
|
|
|
* <p>Use {@link #basePackageClasses} for a type-safe alternative to |
|
|
|
* String-based package names. |
|
|
|
* String-based package names. |
|
|
|
|
|
|
|
* <p>Supports {@code ${...}} placeholders resolved against the |
|
|
|
|
|
|
|
* {@link org.springframework.core.env.Environment Environment} as well as |
|
|
|
|
|
|
|
* Ant-style package patterns (for example, {@code com.example.**}). |
|
|
|
|
|
|
|
* Multiple packages and/or patterns may be specified. |
|
|
|
|
|
|
|
* <p><strong>Note:</strong> Ant-style patterns are <em>not</em> applicable to |
|
|
|
|
|
|
|
* {@link #basePackageClasses()}, which accepts concrete classes for type-safe |
|
|
|
|
|
|
|
* package selection. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@AliasFor("value") |
|
|
|
@AliasFor("value") |
|
|
|
String[] basePackages() default {}; |
|
|
|
String[] basePackages() default {}; |
|
|
|
@ -95,6 +106,8 @@ public @interface ComponentScan { |
|
|
|
* to scan for annotated components. The package of each class specified will be scanned. |
|
|
|
* to scan for annotated components. The package of each class specified will be scanned. |
|
|
|
* <p>Consider creating a special no-op marker class or interface in each package
|
|
|
|
* <p>Consider creating a special no-op marker class or interface in each package
|
|
|
|
* that serves no purpose other than being referenced by this attribute. |
|
|
|
* that serves no purpose other than being referenced by this attribute. |
|
|
|
|
|
|
|
* <p><strong>Note:</strong> Ant-style package patterns do not apply here; this |
|
|
|
|
|
|
|
* attribute accepts concrete classes only and derives packages from those classes. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
Class<?>[] basePackageClasses() default {}; |
|
|
|
Class<?>[] basePackageClasses() default {}; |
|
|
|
|
|
|
|
|
|
|
|
|