public class CandidateComponentsIndex
extends java.lang.Object
META-INF/spring.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", "org.springframework.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.
Modifier and Type | Class and Description |
---|---|
private static class |
CandidateComponentsIndex.Entry |
Modifier and Type | Field and Description |
---|---|
private MultiValueMap<java.lang.String,CandidateComponentsIndex.Entry> |
index |
private static AntPathMatcher |
pathMatcher |
Constructor and Description |
---|
CandidateComponentsIndex(java.util.List<java.util.Properties> content) |
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.String> |
getCandidateTypes(java.lang.String basePackage,
java.lang.String stereotype)
Return the candidate types that are associated with the specified stereotype.
|
private static MultiValueMap<java.lang.String,CandidateComponentsIndex.Entry> |
parseIndex(java.util.List<java.util.Properties> content) |
private static final AntPathMatcher pathMatcher
private final MultiValueMap<java.lang.String,CandidateComponentsIndex.Entry> index
CandidateComponentsIndex(java.util.List<java.util.Properties> content)
public java.util.Set<java.lang.String> getCandidateTypes(java.lang.String basePackage, java.lang.String stereotype)
basePackage
- the package to check for candidatesstereotype
- the stereotype to usestereotype
or an empty set if none has been found for the specified basePackage
private static MultiValueMap<java.lang.String,CandidateComponentsIndex.Entry> parseIndex(java.util.List<java.util.Properties> content)