So far the beans we've seen have used standard patterns to expose their properties, methods, and events to a builder's tool. For more general introspection, you can proved a class specifically to describe the bean.
|
This class implements the java.beans.BeanInfo interface.
|
If you have a Bean class named Xyz, the its beaninfo class is named XyzBeanInfo.
|
If you don't want to supply new versions of all the methods in the BeanInfo interface, you can extend the class java.beans.SimpleBeanInfo, which provide null methods. For any method which is null, a builder's tool will use the standard reflection to find standard properties, etc.
-
this allows one to violate all the design patterns for methods events and properties and supply information by hand!
|