Basic HTML version of Foils prepared May 19 99

Foil 36 BeanInfo

From Javabeans Basic Information Track Computational Science Course CPS616 -- Spring Semester 1999. by Geoffrey Fox, Nancy McCracken, Wojtek Furmanski

TextEditor, a bean example with bound properties, property changes, and BeanInfo.
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!



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Mon Jul 5 1999