ApplicationContext context = new ClassPathXmlApplicationContext("com/tj/constructor/applicationContext.xml");
Person person = (Person)context.getBean("person");
System.out.println(person.getName());
List list = person.getList();
Iterator it = list.iterator();
while(it.hasNext()){
System.out.println(it.next());
}
for (Object object : list) {
System.out.println(object.toString());
}
Map m = person.getMap();
Iterator it3 = m.keySet().iterator();
while (it3.hasNext()) {
Object key = it3.next();
Object value = m.get(key);
System.out.println(key+"--"+value);
}
Set set = person.getSet();
Iterator it1 = set.iterator();
while (it1.hasNext()) {
Object object = (Object) it1.next();
System.out.println(object.toString()+"---");
}
Properties p = person.getPp();
Iterator it2 = p.keySet().iterator();
while(it2.hasNext()){
Object key = it2.next();
System.out.println(key+"---"+p.get(key));
}
Spring配置文件的测试
最新推荐文章于 2022-09-01 13:08:14 发布