少年阿賓

          那些青春的歲月

            BlogJava :: 首頁 :: 聯(lián)系 :: 聚合  :: 管理
            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 閱讀(577) 評論(0)  編輯  收藏 所屬分類: Apache Commons

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


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 新干县| 南溪县| 湖北省| 青田县| 杨浦区| 大石桥市| 清河县| 古蔺县| 苏尼特右旗| 马边| 石台县| 安仁县| 冷水江市| 库尔勒市| 娱乐| 阿荣旗| 闻喜县| 辛集市| 乌拉特后旗| 灌云县| 巨鹿县| 萨迦县| 禹州市| 当涂县| 红桥区| 揭东县| 余姚市| 德令哈市| 新营市| 五莲县| 灵台县| 丰都县| 锡林郭勒盟| 喀喇| 齐齐哈尔市| 丰顺县| 高邑县| 图们市| 松滋市| 荥经县| 大新县|