码迷,mamicode.com
首页 > 其他好文 > 详细

beanutils中WrapDynaBean

时间:2014-10-27 06:52:17      阅读:218      评论:0      收藏:0      [点我收藏+]

标签:ar   sp   bs   ad   new   as   res   return   nbsp   

public class Emp   {

    private String  firstName="李";
    private String lastName;
    public Emp() {
    } ;  
    
     public String getFirstName() {
        return firstName;
    }
     public void setFirstName(String firstName) {
         this.firstName=firstName;
     }
     public String getLastName() {
        return lastName;
    }
     public void setLastName(String lastName){
         this.lastName=lastName;
     }
     private Date hireDate;
     public Date getHireDate(){
         return hireDate;
     }
     public void setHireDate(Date hireDate){
         this.hireDate=hireDate;
     }
     private boolean manager;
     public boolean isManager(){
         return manager;
     }
     public void setManager(boolean manager){
         this.manager=manager;
     }
     public String getFullName(){
         return lastName+firstName;
     }
     
     public Emp getEmployee(int index) {
        return new Emp();
    }
     //private Address address;
     public Address getAddress(String home) {
        return new Address();
    }
//     public void setAddress(Address address) {
//         System.out.println(address);
//        this.address=address;
//    }

}

 

public class WarDynaClassTest {

    public static void main(String[] args) {
        Emp emp=new Emp();
        DynaBean war=new WrapDynaBean(emp);
        System.out.println(war.get("firstName"));
    }

}

beanutils中WrapDynaBean

标签:ar   sp   bs   ad   new   as   res   return   nbsp   

原文地址:http://www.cnblogs.com/danmao/p/4053358.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!