O'Reilly logo

Developing Java Beans by Robert Englander

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Customizers

A customizer is a user interface for customizing an entire Bean, as opposed to a single property. The characteristics and behaviors of the Bean that can be modified by a customizer are not limited to its exposed properties. There can be any number of other settings that are needed to configure a Bean that are not considered properties.

The complexity of the configuration options for a Bean is another possible reason to provide a customizer. This gives you an opportunity to present these choices in a way that makes more sense to a user, and might even provide a mechanism which can guide the user through the process.

If you provide a customizer, you must also provide a BeanInfo class for your Bean in order to identify its associated customizer class. There is no standard naming convention that can be followed, nor is there any kind of customizer manager class provided by the JDK. This is another area that seems inconsistent. I don’t see any reason why a run-time registration mechanism, like that provided by the java.beans.PropertyEditorManager, could not have been provided for registering Bean customizers at run-time. Likewise, I think a naming convention that appends the string Customizer to the Bean class name would have been useful, allowing for the creation of customizers without the need for creating a BeanInfo class. However, it is almost trivial to create a BeanInfo class solely for the purpose of specifying an associated customizer class.

Although customizers are ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required