2012年2月4日

摘要: 我们在操作JavaBean的时候 我们可以用Introspector的方式来操作,但是呢这样需要我们写大量的代码 。 Apache小组为我们提供了很有用的工具包来操作JavaBean 也就是BeanUtils工具包 ,这个可以到 apache.org 上面下载 commons-BeanUtils工具包,同时我们也要下载Logging也就是日志工具包 。我们下载好了BeanUtils工具包之后 打开之后 发现你面有一个docs 那个就是帮助文档 介绍了 Beanutils工具包中各种类的使用 ,这里 我们主要用到BeanUtils类BeanUtils类中的所有方法都是静态方法 我们通过它的get 阅读全文
posted @ 2012-02-04 21:13 风尘女子 阅读(247) 评论(0) 推荐(0) 编辑
摘要: 2段简单的JavaBean代码演示了简单内省操作以及复杂内省操作 。1、简单内省操作 package me.test;import java.lang.reflect.*;import java.beans.IntrospectionException;import java.beans.PropertyDescriptor;public class IntroSpectorTest{ public static void main(String []args) throws IntrospectionException, IllegalArgumentException, IllegalAc 阅读全文
posted @ 2012-02-04 14:58 风尘女子 阅读(122) 评论(0) 推荐(0) 编辑

导航