package com.auto.test;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import net.sf.cglib.beans.BeanGenerator;
import net.sf.cglib.beans.BeanMap;
public class Test2 {
public static void main(String[] args) throws IllegalArgumentException,
IllegalAccessException, InvocationTargetException {
BeanGenerator generator = new BeanGenerator();
generator.addProperty("name", String.class);
Object o = generator.create();
System.out.println(o.getClass());
BeanMap b = BeanMap.create(o);
b.put("name", "zhongjingwu");
Class clazz = o.getClass();
Method[] methods = clazz.getDeclaredMethods();
Field[] fields = clazz.getDeclaredFields();
for (int i = 0; i < fields.length; i++) {
System.out.println(