com.gitee.l0km.casban.annotations.CasbanScan Maven / Gradle / Ivy
package com.gitee.l0km.casban.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import com.gitee.l0km.common.spring.core.annotation.AliasFor;
/**
* 定义类扫描范围
* @author guyadong
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface CasbanScan {
/**
* Alias for {@link #basePackages}.
* Allows for more concise annotation declarations if no other attributes
* are needed — for example, {@code @ComponentScan("org.my.pkg")}
* instead of {@code @ComponentScan(basePackages = "org.my.pkg")}.
*/
@AliasFor(AnnotationFieldNames.BASE_PACKAGES)
String[] value() default {};
/**
* Base packages to scan for annotated components.
*
{@link #value} is an alias for (and mutually exclusive with) this
* attribute.
*
Use {@link #basePackageClasses} for a type-safe alternative to
* String-based package names.
*/
@AliasFor(AnnotationFieldNames.VALUE)
String[] basePackages() default {};
/**
* Type-safe alternative to {@link #basePackages} for specifying the packages
* to scan for annotated components. 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.
*/
Class>[] basePackageClasses() default {};
/**
* excluded base packages to scan for annotated components.
*
Use {@link #excludePackageClasses} for a type-safe alternative to
* String-based package names.
*
Ignored if not sub package of {@link #basePackages},
*
Ignored if exists duplicated package in {@link #basePackages}
*/
String[] excludePackages() default {};
Class>[] excludePackageClasses() default {};
/**
* excluded package suffixes to scan for annotated components.
* such as:
*
* - '.internal' exclude package 'pkg.internal'
* - 'framework' exclude package 'org.apache.springframework' and ''org.apache.framework''
*
* Ignored if exists duplicated package in {@link #basePackages} or {@link #excludePackages}
*/
String[] excludePackageTails() default {};
}