Bean Customizer in Java

0
201
digitization, transformation, binary
Spread the love

Bean Customizer in Java
Bean Customizer in Java

Bean Customizer in Java:

If a class wants to customize a java bean , then it must implement Customizer interface . The class always has to be a subclass of java.awt.Component. It must define all the methods of the Customizer interface.
The class should have no argument constructor . This enables an application builder to invoke the same.
It is useful when we allow an user to easily configure the bean.(Configuration is like providing simply properties like keys and values).
The customizer class if present inside a java Bean,we need to associate it via BeanDescriptor object which it turn returned by BenaInfo class.

The interface of the Customizer is given as below:


public abstract interface java.bean.Customizer {
//Methods
public abstract void addPropertyChangeListener(PropertyChangeListener listener);
//this method is used to register PropertyChangedListener object.
public abstract void removePropertyChangeListener(PropertyChangeListener listener);
//this method is used to de-register PropertyChangedListener object.
public abstract void setObject(Object bean);
//If the Customizer class is created by none but the coder of the same bean class,
//it needs to be instantiated and used by application builder.Once it is instantiated,
// we need to call setObject() method to specify the bean object.
}
 


Spread the love
READ  Class ParsePosition in Java
I am the founder and owner of the blog - TechTravelHub.com, always love to share knowledge on test automation,tools,techniques and tips.I am a passionate coder of Java and VBScript.I also publish articles on Travel ideas and great honeymoon destinations.Apart from these, I am a gear-head,love to drive across India. I have shared lots of articles here on How to travel several parts of India.Customization of cars aka car modification is my another hobby.Get in touch with me on ani01104@gamil.com

LEAVE A REPLY

Please enter your comment!
Please enter your name here