本文整理汇总了Java中org.springframework.context.annotation.AnnotatedBeanDefinitionReader.setScopeMetadataResolver方法的典型用法代码示例。如果您正苦于以下问题:Java AnnotatedBeanDefinitionReader.setScopeMetadataResolver方法的具体用法?Java AnnotatedBeanDefinitionReader.setScopeMetadataResolver怎么用?Java AnnotatedBeanDefinitionReader.setScopeMetadataResolver使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.context.annotation.AnnotatedBeanDefinitionReader
的用法示例。
在下文中一共展示了AnnotatedBeanDefinitionReader.setScopeMetadataResolver方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: suite
import org.springframework.context.annotation.AnnotatedBeanDefinitionReader; //导入方法依赖的package包/类
public static Test suite() {
GenericApplicationContext ac = new GenericApplicationContext();
AnnotatedBeanDefinitionReader bdr = new AnnotatedBeanDefinitionReader(ac);
bdr.setScopeMetadataResolver(new Jsr330ScopeMetadataResolver());
bdr.registerBean(Convertible.class);
bdr.registerBean(DriversSeat.class, Drivers.class);
bdr.registerBean(Seat.class, Primary.class);
bdr.registerBean(V8Engine.class);
bdr.registerBean(SpareTire.class, "spare");
bdr.registerBean(Cupholder.class);
bdr.registerBean(Tire.class, Primary.class);
bdr.registerBean(FuelTank.class);
ac.refresh();
Car car = ac.getBean(Car.class);
return Tck.testsFor(car, false, true);
}
示例2: initAnnotatedConf
import org.springframework.context.annotation.AnnotatedBeanDefinitionReader; //导入方法依赖的package包/类
private static void initAnnotatedConf(GenericApplicationContext context){
Class componentScanAnnotated=ProcessInfo.getAnnotationInitClass();
if(componentScanAnnotated!=null){
AnnotatedGenericBeanDefinition def=new AnnotatedGenericBeanDefinition(ProcessInfo.getAnnotationInitClass());
AnnotatedBeanDefinitionReader reader=new AnnotatedBeanDefinitionReader(context);
AnnotationScopeMetadataResolver resolver=new AnnotationScopeMetadataResolver();
resolver.resolveScopeMetadata(def);
reader.setScopeMetadataResolver(resolver);
}
}