????Java??÷?????????get set ????
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
/**
*
*/
/**
* @ClassName: ReflectTest
* @Description: TODO(????????仰??????????????)
* @author zhoushun
* @date 2013??11??26?? ????5:11:35
*
*/
public class ReflectTest {
public static void main() throws Exception{
ReflectTest bo = new ReflectTest();
Field[] fields = bo.getClass().getDeclaredFields();
// д????
for(Field ff : fields) {
String name = ff.getName();    //????????????
String type = ff.getGenericType().toString();    //????????????
ff.setAccessible(true);
PropertyDescriptor pd = new PropertyDescriptor(ff.getName()?? bo.getClass());
Method rM = pd.getReadMethod();//????????
Object num = (Object) rM.invoke(bo);
if(num == null) {
Method wM = pd.getWriteMethod();//???д????
if(type.equals("class java.lang.Integer")){
}
if(type.equals("class java.lang.Short")){
}
if(type.equals("class java.lang.Double")){
}
if(type.equals("class java.lang.Boolean")){
}
if(type.equals("class java.util.Date")){
}
wM.invoke(bo?? "1");//????????int?????????????????int??????????????????????ж???????????????
}
}
}
}