@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.MapFactoryBean的实例源码
XmlBeanCollectionTests.java 文件源码
项目:spring4-understanding
阅读 27
收藏 0
点赞 0
评论 0
XmlBeanCollectionTests.java 文件源码
项目:class-guard
阅读 22
收藏 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
阅读 27
收藏 0
点赞 0
评论 0
@Override
protected Class<?> getBeanClass(Element element) {
return MapFactoryBean.class;
}
UtilNamespaceHandler.java 文件源码
项目:spring4-understanding
阅读 27
收藏 0
点赞 0
评论 0
@Override
protected Class<?> getBeanClass(Element element) {
return MapFactoryBean.class;
}
UtilNamespaceHandler.java 文件源码
项目:spring
阅读 23
收藏 0
点赞 0
评论 0
@Override
protected Class<?> getBeanClass(Element element) {
return MapFactoryBean.class;
}
UtilNamespaceHandler.java 文件源码
项目:class-guard
阅读 27
收藏 0
点赞 0
评论 0
@Override
protected Class getBeanClass(Element element) {
return MapFactoryBean.class;
}
ConnectionPropertiesParser.java 文件源码
项目:spring-cloud-connectors
阅读 24
收藏 0
点赞 0
评论 0
@Override
protected String getBeanClassName(Element element) {
return MapFactoryBean.class.getName();
}