Example of generated feature code

Suppose you define simpleString, the most basic property useful for visual composition: readable, writable, and bound to an event. VisualAge generates the following items:

If simpleString is also indexed, fieldSimpleString is a private field of type java.lang.String[ ]. Accordingly, setSimpleString( ) takes java.lang.String[ ] as a parameter.

VisualAge also generates the following methods to access individual elements of the array. Unlike the previous accessors, these methods are exposed in BeanInfo:

Suppose you define an existing event set, action, for use in your class using default values in the New Event Set SmartGuide. VisualAge generates the following items:

Suppose you define stringModified, a new listener event specifically for your class. VisualAge generates the following items:


Related concepts
Generated code
Generated BeanInfo descriptor code (an advanced topic)
Code generated from visually composed beans
How generated code coexists with user-written code

Related procedures
Defining bean interfaces for visual composition

Related references
Example of code generated from visual composite
Beans for visual composition