What is introspection in JavaBeans?

John Zukowski

Introspection is the ability to ask a JavaBean component what properties and events it supports. By default, introspection is supported by reflection, where you name methods with certain naming patterns, like set/getProperty() and add/removeListener(). You can also explicitly expose the bean's behavior through creation of a BeanInfo class related to the bean. The BeanInfo class can be used for many things, like setting up an icon for the component when used in a bean builder tool like JBuilder, limiting the properties available, or mapping methods to properties that don't follow standard naming patterns.