Creating a Bean Property

See Also 

  1. In the Filesystems window, find the class for your bean, expand its node, and right-click Bean Patterns.
  2. From the contextual menu, choose Add and choose  or Add and choose  .

    The New Property Pattern or New Indexed Property Pattern dialog box appears, enabling you to customize the code to be generated for the property.

  3. Type in a name for the property. The name must be a valid Java identifier.

    When the property is generated, get is added as a prefix to the property name for the getter method and set is added as a prefix for the setter method. For Boolean properties, the IDE adds is to the property name for the getter method.

  4. In the Type combo box, select the type of property from the list, or type in a class identifier.
  5. In the Mode combo box, select Read Only to generate the getter method, Write Only to generate the setter method, or Read/Write to generate both.
  6. Select or both options if applicable.

    The usefulness of these options is enhanced if you also select the Generate Property Change Support option as described in Step 7.

  7. Select any combination of these options in the New Property Pattern dialog box: If you are creating an indexed property, each getter and setter method that is generated with these four options includes a parameter for the index of the element to be read or written. In addition, you can select Non-Index Options to generate getter and setter methods that apply to all elements of the array.
  8. Click OK to generate the component property methods for the selected class.
See Also
Creating a Bean
Creating a Bean Event Set
Deleting a Property or Event Set
Generating BeanInfo

Legal Notices