Introspection Java Help

Introspection

Introspection is the process of analyzing a Bean to determine its capabilities. This is an. essential feature of the Java Beans API, because it allows an application builder tool to
present information about a component to a software designer: Without introspection, the Java Beans technology could not operate.  There are two ways in which the developer of a Bean can indicate which of its . properties, events, and methods should be exposed by an application builder tool. With the first method, simple naming conventions are used. These allow the introspection mechanisms to infer information about a Bean. In the second way, and additional class is provided that explicitly supplies this information, The first approach is examined- here. The second method is described later. . The following sections indicate the design patterns for properties and events that enable the functionality of a Bean to be determined.

Design’ Patterns for Properties
A property is a subset of a Bean’s state. The values assigned to the properties determine the behavior and appearance of that component. This section discusses three types of  properties: simple, Boolean, and indexed.

Boolean Properties

A Boolean property has a value of true or false. It can be,identified by the following
design patterns, where N is name of the property:
public boolean isN( );
public boolean gelN( );
public void setN(boolean value);
Either the first or second pattern can be used to retrieve the value of a Boolean properly. However. if a class has both of these methods, the first pattern is used The following listing shows a class that has one Boolean property:

[vfb id=1]

Posted on September 18, 2014 in Java Beans

Share the Story

About the Author

Back to Top
Share This