Refactor AnnotationUtils#findAllAnnotationAttributes
Remove all convenience variants of #findAllAnnotationAttributes and refactor the remaining method to accept a MetadataReaderFactory instead of creating its own SimpleMetadataReaderFactory internally. This allows clients to use non-default class loaders as well as customize the particular MetadataReaderFactory to be used (e.g. 'simple' vs 'caching', etc). Issue: SPR-8752
This commit is contained in:
@@ -39,6 +39,7 @@ import java.util.Map;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.type.classreading.SimpleMetadataReaderFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
@@ -221,7 +222,9 @@ public class AnnotationUtilsTests {
|
||||
@Test
|
||||
public void findAllComponentAnnotationAttributes() throws IOException {
|
||||
List<Map<String,Object>> allAttribs =
|
||||
AnnotationUtils.findAllAnnotationAttributes(Component.class, HasLocalAndMetaComponentAnnotation.class.getName());
|
||||
AnnotationUtils.findAllAnnotationAttributes(Component.class,
|
||||
HasLocalAndMetaComponentAnnotation.class.getName(), false,
|
||||
new SimpleMetadataReaderFactory());
|
||||
|
||||
Object value = null;
|
||||
for (Map<String, Object> attribs : allAttribs) {
|
||||
|
||||
Reference in New Issue
Block a user