类 CandidateComponentsIndex
java.lang.Object
cn.taketoday.context.loader.CandidateComponentsIndex
Provide access to the candidates that are defined in
META-INF/today.components.
An arbitrary number of stereotypes can be registered (and queried) on the index: a
typical example is the fully qualified name of an annotation that flags the class for
a certain use case. The following call returns all the @Component
candidate types for the com.example package (and its sub-packages):
Set<String> candidates = index.getCandidateTypes(
"com.example", "cn.taketoday.stereotype.Component");
The type is usually the fully qualified name of a class, though this is
not a rule. Similarly, the stereotype is usually the fully qualified name of
a target type but it can be any marker really.
- 从以下版本开始:
- 4.0 2021/12/9 21:34
- 作者:
- Stephane Nicoll, Harry Yang
-
方法概要
修饰符和类型方法说明getCandidateTypes(String basePackage, String stereotype) Return the candidate types that are associated with the specified stereotype.
-
方法详细资料
-
getCandidateTypes
Return the candidate types that are associated with the specified stereotype.- 参数:
basePackage- the package to check for candidatesstereotype- the stereotype to use- 返回:
- the candidate types associated with the specified
stereotypeor an empty set if none has been found for the specifiedbasePackage
-