少年阿賓

          那些青春的歲月

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

          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 閱讀(573) 評論(0)  編輯  收藏 所屬分類: Apache Commons

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


          網站導航:
           
          主站蜘蛛池模板: 收藏| 大同县| 安岳县| 鄄城县| 琼海市| 防城港市| 开封县| 手游| 香格里拉县| 泰州市| 舞钢市| 通城县| 天津市| 黑河市| 祁东县| 公安县| 双桥区| 桃江县| 蛟河市| 阿巴嘎旗| 菏泽市| 绥中县| 台东县| 阿勒泰市| 启东市| 三原县| 紫金县| 吴江市| 五指山市| 宜兰县| 遵义市| 恭城| 广南县| 麻栗坡县| 财经| 襄汾县| 尉氏县| 武穴市| 马关县| 开阳县| 荔浦县|