java基础知识积累

1.2014年5月20日15:58:48:

(1)getDeclaredFields()返回Class中所有的字段,包括私有字段;

(2)getFields  只返回公共字段,即有public修饰的字段

(3)Field : isAnnotationPresent(Class<? extends Annotaion>)方法里的参数必须是Annotation的子类 

(4)PropertyDescriptor : PropertyDescriptor类表示JavaBean类通过存储器导出一个属性。

  主要方法:
  1、getPropertyType(),获得属性的Class对象。
  2、getReadMethod(),获得用于读取属性值的方法;getWriteMethod(),获得用于写入属性值的方法。
  3、hashCode(),获取对象的哈希值。
  4、setReadMethod(Method readMethod),设置用于读取属性值的方法;

posted @ 2014-05-20 15:59  muzi131313  阅读(76)  评论(0编辑  收藏  举报