posts - 0,  comments - 5,  trackbacks - 0
          ?接口類ListService
          @SuppressWarnings("unchecked")
          public?interface?ListService
          {
          ????
          public?List?getString();
          ????
          public?List?getListofListofString();
          ????
          public?Map?getStringMap(Map?map);
          ????
          public?Map?getMapofMapofString(Map?map);
          }

          ??實現(xiàn)接口類ListServiceImp
          @SuppressWarnings(
          "unchecked")
          public?class?ListServiceImp?implements?ListService
          {
          ????
          public?List?getListofListofString()
          ????
          {
          ????????List?list?
          =?new?ArrayList();
          ????????
          for(int?i=0;?i<5;?i++)
          ????????
          {
          ????????????list.add(getString());
          ????????}

          ????????
          return?list;
          ????}


          ????
          public?List?getString()
          ????
          {
          ????????List?list?
          =?new?ArrayList();
          ????????
          for(int?i=0;?i<5;?i++)
          ????????
          {
          ????????????list.add(i
          +"==");
          ????????}

          ????????
          return?list;
          ????}


          ????@Override
          ????
          public?Map?getMapofMapofString(Map?mapP)
          ????
          {
          ????????Map?map?
          =?new?HashMap();
          ????????Iterator?it?
          =?mapP.keySet().iterator();
          ????????
          while(it.hasNext())
          ????????
          {
          ????????????
          int?key?=?(Integer)it.next();
          ????????????map.put(key,?getStringMap(mapP));
          ????????}


          ????????
          return?map;
          ????}


          ????@Override
          ????
          public?Map?getStringMap(Map?mapP)
          ????
          {
          ????????Map?map?
          =?new?HashMap();
          ????????Iterator?it?
          =?mapP.keySet().iterator();
          ????????
          while(it.hasNext())
          ????????
          {
          ????????????
          int?key?=?(Integer)it.next();
          ????????????
          int?value?=?(Integer)mapP.get(key);
          ????????????map.put(key,?value
          +":"+value);
          ????????}

          ????????
          return?map;
          ????}

          }

          集合對象綁定ListService.aegis.xml 此文件寫接口名一樣
          <?xml?version="1.0"?encoding="UTF-8"?>??
          <mappings>??
          ????
          <mapping>??
          ????????
          <method?name="getString">
          ??????????????
          <return-type?componentType="java.lang.String"?/>
          ????????
          </method>
          ????????
          ????????
          <method?name="getListofListofString">
          ??????????????
          <return-type?componentType="#someString"?/>
          ????????
          </method>
          ????????
          <component?name="someString"?class="java.util.List"??componentType="java.lang.String"?/>
          ????????
          ????????
          <method?name="getStringMap">
          ??????????????
          <return-type?componentType="java.lang.String"?/>
          ????????
          </method>
          ????????
          ????????
          <method?name="getMapofMapofString">
          ??????????????
          <return-type?componentType="#someMap"?/>
          ????????
          </method>
          ????????
          <component?name="someMap"?class="java.util.Map"??componentType="java.lang.String"?/>
          ????????
          ????
          </mapping>??
          </mappings>??

          可以參考http://dist.codehaus.org/ xfire/ sources/ xfire-src-1.1.2.zip/ xfire-1.1.2/ xfire-aegis/ src/ test/ org/ codehaus/ xfire/ aegis/ type/ collection/中的代碼看看
          posted on 2008-06-25 19:47 crazy 閱讀(744) 評論(0)  編輯  收藏 所屬分類: java
          主站蜘蛛池模板: 榆林市| 江陵县| 高台县| 绥宁县| 东阿县| 六安市| 汉阴县| 灵寿县| 福泉市| 邯郸县| 巴东县| 桂平市| 砚山县| 梅州市| 安陆市| 镇远县| 佛山市| 新干县| 化德县| 庆阳市| 邵阳县| 丰镇市| 靖远县| 丽江市| 铜鼓县| 望都县| 凤庆县| 梅河口市| 鄂托克旗| 成都市| 昌图县| 南雄市| 惠水县| 敖汉旗| 成武县| 察隅县| 宜川县| 通江县| 昭觉县| 海口市| 内江市|