少年阿賓

          那些青春的歲月

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            500 Posts :: 0 Stories :: 135 Comments :: 0 Trackbacks

          常用鏈接

          留言簿(22)

          我參與的團隊

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          package com.abin.lee.apache;

          import java.lang.reflect.InvocationTargetException;

          import org.apache.commons.beanutils.BeanUtils;

          import com.abin.lee.apache.bean.AirBean;
          import com.abin.lee.apache.bean.SkyBean;

          public class ApacheBeanUtils {
           public static void main(String[] args) throws Exception {
            AirBean air=new AirBean();
            BeanUtils.setProperty(air, "id", "1");
            BeanUtils.setProperty(air, "name", "abin");
            
            SkyBean sky=new SkyBean();
            BeanUtils.copyProperties(sky, air);
            
          //  String id=BeanUtils.getProperty(sky, "id");
          //  String name=BeanUtils.getProperty(sky, "name");
          //  System.out.println("id="+id);
          //  System.out.println("name="+name);
            System.out.println("id="+sky.getId());
            System.out.println("name="+sky.getName());
            System.out.println("name="+sky.getClass());
           }

          }

          posted on 2012-10-19 12:50 abin 閱讀(572) 評論(0)  編輯  收藏 所屬分類: Apache Commons

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 武安市| 建德市| 竹北市| 新乡县| 拜城县| 江北区| 澄城县| 武定县| 台江县| 日喀则市| 英超| 丽江市| 西华县| 涿州市| 南和县| 上高县| 嘉峪关市| 莱芜市| 贺兰县| 东乌珠穆沁旗| 澳门| 于都县| 凤阳县| 黄平县| 区。| 西乌| 望奎县| 通州市| 泗水县| 南召县| 中方县| 罗田县| 佛山市| 沂源县| 桐乡市| 榆社县| 越西县| 同江市| 阿拉尔市| 禹州市| 永济市|