This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages)
|
In computing based on the Java Platform, JavaBeans is a technology developed by Sun Microsystems and released in 1996, as part of JDK 1.1.
The 'beans' of JavaBeans are classes that encapsulate one or more objects into a single standardized object (the bean). This standardization allows the beans to be handled in a more generic fashion, allowing easier code reuse and introspection. This in turn allows the beans to be treated as software components, and to be manipulated visually by editors and IDEs without needing any initial configuration, or to know any internal implementation details.
As part of the standardization, all beans must be serializable, have a zero-argument constructor, and allow access to properties using getter and setter methods.
The JavaBeans functionality is provided by a set of classes and interfaces in the java.beans
package.
Interface | Description |
---|---|
AppletInitializer | Methods in this interface are used to initialize Beans that are also applets. |
BeanInfo | This interface allows the designer to specify information about the events, methods and properties of a Bean. |
Customizer | This interface allows the designer to provide a graphical user interface through which a bean may be configured. |
DesignMode | Methods in this interface determine if a bean is executing in design mode. |
ExceptionListener | A method in this interface is invoked when an exception has occurred. |
PropertyChangeListener | A method in this interface is invoked when a bound property is changed. |
PropertyEditor | Objects that implement this interface allow the designer to change and display property values. |
VetoableChangeListener | A method in this interface is invoked when a Constrained property is changed. |
Visibility | Methods in this interface allow a bean to execute in environments where the GUI is not available. |
In order to function as a JavaBean class, an object class must obey certain conventions about method naming, construction, and behaviour. These conventions make it possible to have tools that can use, reuse, replace, and connect Java Beans.
The required conventions are as follows:
package player;
public class PersonBean implements java.io.Serializable {
/** Properties **/
private boolean deceased = false;
private List list;
/** Property "name", readable/writable. */
private String name = null;
/** No-arg constructor (takes no arguments). */
public PersonBean() {
}
public List getList() {
return list;
}
public void setList(final List list) {
this.list = list;
}
/**
* Getter for property "name".
*/
public String getName() {
return name;
}
/**
Javabeans Tutorials: A javabean is a custom class which often represents real-world data and encapsulates private properties by public getter and setter methods. For example, User, Product, Order, etc.
Latest online Javabeans Tutorials with example so this page for both freshers and experienced candidate who want to get job in Javabeans company
Latest online Javabeans Tutorials for both freshers and experienced
advertisements
View Tutorials on Javabeans
- 6 >Hyderabad
- 7 >Kolkata
- 8 >Kochi
- 9 >Ahmedabad
- 10 >Trivandrum
- 11 >Bhubaneshwar
- 12 >Indore
- 13 >Coimbatore
- 14 >Goa
Ask your interview questions on Javabeans