下载地址:http://commons.apache.org/beanutils/
例子如下:
新建Bean:
package demo.bean;
import java.util.ArrayList;
import java.util.HashMap;
public class Company ...{
private String name;
private HashMap<String, String> address = new HashMap<String, String>();
private String[] otherInfo;
private ArrayList<String> product;
private ArrayList<String> employee;
private HashMap<String, String> telephone;
public String getName() ...{
return name;
}
public void setName(String name) ...{
this.name = name;
}
public HashMap<String, String> getAddress() ...{
return address;
}
public void setAddress(HashMap<String, String> address) ...{
this.address = address;
}
public String[] getOtherInfo() ...{
return otherInfo;
}
public void setOtherInfo(String[] otherInfo) ...{
this.otherInfo = otherInfo;
}
public ArrayList<String> getProduct() ...{
return product;
}
public void setProduct(ArrayList<String> product) ...{
this.product = product;
}
public ArrayList<String> getEmployee() ...{
return employee;
}
public void setEmployee(ArrayList<String> employee) ...{
this.employee = employee;
}
public HashMap<String, String> getTelephone() ...{
return telephone;
}
public void setTelephone(HashMap<String, String> telephone) ...{
this.telephone = telephone;
}
}