少年阿賓

          那些青春的歲月

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

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


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 民县| 中西区| 咸宁市| 崇文区| 鄂尔多斯市| 上高县| 纳雍县| 黑河市| 招远市| 蒲城县| 翼城县| 汝州市| 曲阜市| 岑溪市| 白水县| 开江县| 柳林县| 高清| 新巴尔虎左旗| 嵩明县| 县级市| 南召县| 全椒县| 彰化市| 田阳县| 宜黄县| 镇宁| 孟津县| 长海县| 弥渡县| 信丰县| 夏河县| 竹山县| 洛隆县| 大洼县| 金乡县| 格尔木市| 彭泽县| 泰安市| 开阳县| 榆社县|