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
          主站蜘蛛池模板: 富源县| 宁阳县| 长乐市| 绵竹市| 平和县| 新和县| 都匀市| 辽中县| 济宁市| 多伦县| 敦化市| 江川县| 渭南市| 家居| 肥乡县| 多伦县| 忻州市| 沽源县| 迁安市| 左权县| 镶黄旗| 林芝县| 新化县| 即墨市| 高阳县| 大理市| 平江县| 潜山县| 奎屯市| 隆回县| 柳林县| 泸定县| 宣化县| 腾冲县| 河津市| 海宁市| 洛扎县| 阿坝| 新巴尔虎右旗| 克东县| 辽宁省|