摘要: Sun公司的内省API过于繁琐,所以Apache组织结合很多实际开发中的应用场景开发了一套简单、易用的API操作Bean的属性——BeanUtils,在Beanutil中可以直接进行类型的自动转换。BeanUtil工具包下载:1,登录http://commons.apache.org/beanuti... 阅读全文
posted @ 2014-06-17 21:08 是但哥 阅读(312) 评论(0) 推荐(0)
摘要: 1 import java.beans.BeanInfo; 2 import java.beans.IntrospectionException; 3 import java.beans.Introspector; 4 import java.beans.PropertyDescriptor; 5... 阅读全文
posted @ 2014-06-16 22:43 是但哥 阅读(194) 评论(0) 推荐(0)
摘要: 1 import java.lang.reflect.Field; 2 3 import org.junit.Test; 4 5 //反射字段 6 public class Demo2 { 7 8 // 反射字段:public String name="aaaa" 9 @Te... 阅读全文
posted @ 2014-06-16 22:08 是但哥 阅读(152) 评论(0) 推荐(0)
摘要: 1 import java.io.FileInputStream; 2 import java.io.InputStream; 3 import java.lang.reflect.Constructor; 4 import java.lang.reflect.InvocationTargetEx... 阅读全文
posted @ 2014-06-16 21:37 是但哥 阅读(156) 评论(0) 推荐(0)
摘要: 1 import java.lang.reflect.Constructor; 2 import java.lang.reflect.InvocationTargetException; 3 import java.util.ArrayList; 4 import java.util.List; ... 阅读全文
posted @ 2014-06-16 21:09 是但哥 阅读(220) 评论(0) 推荐(0)
摘要: 1 public class Demo { 2 3 /** 4 * 反射:加载类,获得类的字节码 5 * @param args 6 * @throws ClassNotFoundException 7 */ 8 public stati... 阅读全文
posted @ 2014-06-16 21:07 是但哥 阅读(479) 评论(0) 推荐(0)
摘要: 1 import org.junit.Test; 2 3 public class Demo { 4 5 /** 6 * 枚举 7 */ 8 @Test 9 public void test() {10 11 print(Grade.... 阅读全文
posted @ 2014-06-14 22:58 是但哥 阅读(132) 评论(0) 推荐(0)
摘要: 1 import org.junit.Test; 2 3 public class Demo { 4 5 /** 6 * 枚举 7 */ 8 @Test 9 public void test() {10 11 print(Grade.... 阅读全文
posted @ 2014-06-14 22:47 是但哥 阅读(1225) 评论(0) 推荐(0)
摘要: 1 import java.util.Arrays; 2 import java.util.List; 3 4 import org.junit.Test; 5 6 7 8 public class Demo { 9 10 /**11 * 可变参数12 */13... 阅读全文
posted @ 2014-06-14 21:22 是但哥 阅读(113) 评论(0) 推荐(0)
摘要: 1 import java.util.ArrayList; 2 import java.util.HashMap; 3 import java.util.Iterator; 4 import java.util.LinkedHashMap; 5 import java.util.List... 阅读全文
posted @ 2014-06-14 21:05 是但哥 阅读(133) 评论(0) 推荐(0)