@Test
public void testCollectionFactoryDefaults() throws Exception {
ListFactoryBean listFactory = new ListFactoryBean();
listFactory.setSourceList(new LinkedList());
listFactory.afterPropertiesSet();
assertTrue(listFactory.getObject() instanceof ArrayList);
SetFactoryBean setFactory = new SetFactoryBean();
setFactory.setSourceSet(new TreeSet());
setFactory.afterPropertiesSet();
assertTrue(setFactory.getObject() instanceof LinkedHashSet);
MapFactoryBean mapFactory = new MapFactoryBean();
mapFactory.setSourceMap(new TreeMap());
mapFactory.afterPropertiesSet();
assertTrue(mapFactory.getObject() instanceof LinkedHashMap);
}
java类org.springframework.beans.factory.config.SetFactoryBean的实例源码
XmlBeanCollectionTests.java 文件源码
项目:spring4-understanding
阅读 23
收藏 0
点赞 0
评论 0
XmlBeanCollectionTests.java 文件源码
项目:class-guard
阅读 25
收藏 0
点赞 0
评论 0
@Test
public void testCollectionFactoryDefaults() throws Exception {
ListFactoryBean listFactory = new ListFactoryBean();
listFactory.setSourceList(new LinkedList());
listFactory.afterPropertiesSet();
assertTrue(listFactory.getObject() instanceof ArrayList);
SetFactoryBean setFactory = new SetFactoryBean();
setFactory.setSourceSet(new TreeSet());
setFactory.afterPropertiesSet();
assertTrue(setFactory.getObject() instanceof LinkedHashSet);
MapFactoryBean mapFactory = new MapFactoryBean();
mapFactory.setSourceMap(new TreeMap());
mapFactory.afterPropertiesSet();
assertTrue(mapFactory.getObject() instanceof LinkedHashMap);
}
UtilNamespaceHandler.java 文件源码
项目:lams
阅读 21
收藏 0
点赞 0
评论 0
@Override
protected Class<?> getBeanClass(Element element) {
return SetFactoryBean.class;
}
UtilNamespaceHandler.java 文件源码
项目:spring4-understanding
阅读 24
收藏 0
点赞 0
评论 0
@Override
protected Class<?> getBeanClass(Element element) {
return SetFactoryBean.class;
}
UtilNamespaceHandler.java 文件源码
项目:spring
阅读 28
收藏 0
点赞 0
评论 0
@Override
protected Class<?> getBeanClass(Element element) {
return SetFactoryBean.class;
}
UtilNamespaceHandler.java 文件源码
项目:class-guard
阅读 30
收藏 0
点赞 0
评论 0
@Override
protected Class getBeanClass(Element element) {
return SetFactoryBean.class;
}