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);
          }

          ??實現接口類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 閱讀(745) 評論(0)  編輯  收藏 所屬分類: java
          主站蜘蛛池模板: 银川市| 河间市| 台安县| 克拉玛依市| 常熟市| 罗城| 二手房| 鲜城| 农安县| 聂拉木县| 越西县| 浮梁县| 晋宁县| 东方市| 杭锦后旗| 桃源县| 郴州市| 宁阳县| 孟州市| 始兴县| 十堰市| 巴南区| 镇平县| 论坛| 富川| 于都县| 汉沽区| 边坝县| 渝北区| 定兴县| 盐边县| 班玛县| 淮滨县| 绿春县| 科尔| 萍乡市| 滨州市| 瑞丽市| 石台县| 什邡市| 宜章县|