Generating Getter and Setter Methods

See Also 

You can generate getter and setter methods for a field in one of the following two ways:

To generate getter and setter methods using the code completion box:

  1. Type the field declaration in the Source Editor and press Enter.
  2. Press Ctrl-Spacebar.
  3. In the code completion box, scroll down to the entry Create getter getFieldName for field FieldName and press Enter.
  4. Press Ctrl-Spacebar.
  5. In the code completion box, scroll down to the entry Create setter setFieldName for field FieldName and press Enter.

To generate getter and setter methods using the Encapsulate Fields command:

Getter and setter methods are generated for that field if they do not already exist. Because generating getter and setter methods for a field makes that field a bean property, a node for the field also appears under the Bean Patterns node.

See Also
Creating a Bean
Creating a Bean Property

Legal Notices