Annotation Interface CommandScan
@Target(TYPE)
@Retention(RUNTIME)
@Documented
@Import(CommandScanRegistrar.class)
@EnableCommand
public @interface CommandScan
Configures the base packages used when scanning for
@Comamnd
classes. One of basePackageClasses()
, basePackages()
or its
alias value()
may be specified to define specific packages to scan.
If specific packages are not defined scanning will occur from the package of
the class with this annotation.-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionClass<?>[]
Type-safe alternative tobasePackages()
for specifying the packages to scan for commands.String[]
Base packages to scan for commands.String[]
Alias for thebasePackages()
attribute.
-
Element Details
-
value
Alias for thebasePackages()
attribute. Allows for more concise annotation declarations e.g.:@CommandScan("org.my.pkg")
instead of@CommandScan(basePackages="org.my.pkg")
.- Returns:
- the base packages to scan
- Default:
- {}
-
basePackages
Base packages to scan for commands.value()
is an alias for (and mutually exclusive with) this attribute.Use
basePackageClasses()
for a type-safe alternative to String-based package names.- Returns:
- the base packages to scan
- Default:
- {}
-
basePackageClasses
Class<?>[] basePackageClassesType-safe alternative tobasePackages()
for specifying the packages to scan for commands. The package of each class specified will be scanned.Consider creating a special no-op marker class or interface in each package that serves no purpose other than being referenced by this attribute.
- Returns:
- classes from the base packages to scan
- Default:
- {}
-