zoukankan      html  css  js  c++  java
  • spring双列

    public class MyCollection {
         private  String[]array;
         private List<String>list;
         private Set<String>set;
         Map<String,String>map;
         Properties properties;
        public String[] getArray() {
            return array;
        }
        public void setArray(String[] array) {
            this.array = array;
        }
        public List<String> getList() {
            return list;
        }
        public void setList(List<String> list) {
            this.list = list;
        }
        public Set<String> getSet() {
            return set;
        }
        public void setSet(Set<String> set) {
            this.set = set;
        }
        public Map<String, String> getMap() {
            return map;
        }
        public void setMap(Map<String, String> map) {
            this.map = map;
        }
        public Properties getProperties() {
            return properties;
        }
        public void setProperties(Properties properties) {
            this.properties = properties;
        }
    }

    <bean id="map" class="cn.happy.spring03xmldi.MyCollection">
    <property name="map">
        <map>
            <!-- map中的每一项entry=key+value  -->
            <entry key="1" value="11"></entry>
            <entry key="2" value="22"></entry>
            <entry key="3">
                <value>33</value>
            </entry>
        </map>
    </property>
    </bean>

    测试

    public void test02(){
    ApplicationContext ct= new ClassPathXmlApplicationContext("applicationContextspring03xmldl.xml");
     MyCollection collection=(MyCollection)ct.getBean("map");
     System.out.println(collection.getMap());
    }

  • 相关阅读:
    POJ 2502 Subway(最短路径)
    HDU 1430 魔板
    HDU 1043 POJ 1077 八数码问题
    POJ 2576 Tug of War 随机算法(非正规解法)
    什么是COM
    6.0的版本的 tc,不支持大漠对象做数组吗?
    Q键连发。按住Q键则连发。松开则停止1。
    Q键连发。按住Q键 则连发。松开则停止2。
    特殊符号。
    僵尸_另类的生命体。
  • 原文地址:https://www.cnblogs.com/wangdan123/p/7398846.html
Copyright © 2011-2022 走看看