Introspector.getBeanInfo(beanClass, stopClass) 返回 BeanInfo,停止於指定父類(通常為 Object.class)。
遍歷三大描述符:
getPropertyType()、getName()、getReadMethod()/getWriteMethod()。getListenerType()、getListenerMethods()、getAddListenerMethod()/getRemoveListenerMethod()。對 Frog Bean 執行 java BeanDumper frogbean.Frog 可見:
color(Color)、spots(Spots)、jumper(boolean)、jumps(int)。croak() 等普通公開方法。KeyListener、ActionListener 完整描述符。視覺化建構工具拖放 Bean 時,即透過內省動態構建屬性表、事件綁定 UI,無需硬編碼。