Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2026240
  • 博文数量: 413
  • 博客积分: 10926
  • 博客等级: 上将
  • 技术积分: 3862
  • 用 户 组: 普通用户
  • 注册时间: 2006-01-09 18:14
文章分类

全部博文(413)

文章存档

2015年(5)

2014年(1)

2013年(5)

2012年(6)

2011年(138)

2010年(85)

2009年(42)

2008年(46)

2007年(26)

2006年(59)

分类: Java

2011-05-16 21:05:32

  1. Docs
  2. Summary
    • Scan all methods, fields, and modified defiend in the specified classes
    • Create a new object
    • Invoke method
    • Change modified (such as public, private, protected)
  3. Important Classes (Class + AccessibleObject)
    • Class
      Class is the in-memory representation of a Java class.
    • Constructor
    • Method
    • Field
    • Modifier
  4. Change accessable (Access private method/field/constructor outside of class)
    Method method; //or Field/Constructor, it is private
    xxx;
    setAccessible(boolean flag);
    method.invoke(xxx);
  5. Sample
    • getDeclaredMethod with primitive type
      (ref: )
      Method m = c.getDeclaredMethod("drinkMe", int.class);
    • Class cls = Class.forName("xxxx");
      Constructor[] array = cls.getConstructors();
    • xxx
  6. xxx
阅读(743) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~