利用BeanUtils工具类给JavaBean设置和取值
import org.apache.commons.beanutils.BeanUtils;import org.apache.commons.beanutils.PropertyUtils;public class BeanutilTest {public static void main(String[] args) throws Exception{Point p = new Point();BeanUtils.setProperty(p, "x", 7);System.out.println(BeanUtils.getProperty(p, "x"));BeanUtils.setProperty(p, "birthday.time", "2011101");System.out.println(BeanUtils.getProperty(p, "birthday.time"));PropertyUtils.setProperty(p, "x", 9);System.out.println(PropertyUtils.getProperty(p, "x"));}}?