GetSet.Creator is a tool that allows easy creation of accessors and/or mutators for selected fields of a class.

GetSet.Creator popup window
GetSet.Creator popup window

When editing a file, press Alt+SHIFT+A (CUA) to invoke GetSet.Creator Insight. The GetSet.Creator popup will be shown with the list of fields matching a word at the cursor position. The list may be empty if there are no matching fields though. To find matches, type a word in the Fields edit box and GetSet.Creator will dynamically rearrange the  list of fields to show the matching ones. You can also leave the Fields edit box blank to view all fields.

GetSet.Creator highlights the fields with names exactly matching the typed word using bold font.

GetSet.Creator analyses all the fields and all the methods those may be considered as accessor or mutator ones and removes certain fields from the list if appropriate methods are already exist.

You can select a field, either one or any, navigating through the list with the help of the usual keyboard. An alternative way to do it is to continue typing the word; the list selection will be changed to produce the closest match possible.

Press the Enter key when you select the required fields(s) and GetSet.Creator will generate applicable accessors and (or) mutators to it (you can select all items in the list using the CTRL+A shortcut). When generating a method, GetSet.Creator analyses the current class as well as all its super classes and super interfaces, so it can call the appropriate method of the super class or skip particular method generation in case of any contradictions.

There is an ability to invoke GetSet.Creator in the mode that allow generating either accessors or mutators methods only using the Alt+SHIFT+G or Alt+SHIFT+S (CUA) shortcuts, respectively.

Options Dependency

In general, GetSet.Creator uses Java Beans convention for naming the accessor and mutator methods. But if your code style assumes using prefixes or(and) suffixes for fields naming, GetSet.Creator allows you to use them without distortion of method names - you just need to specify correct prefixes and suffixes in the Project Properties | Productivity! | Code Style | Fields Naming options group. For example, if you specify prefix m_ and name your field as m_count , GetSet.Creator generates methods as getCount() and setCount(...).

GetSet.Creator can generate JavaDoc comments during methods generation. To control this, please use the options on the Project Properties | Productivity! | JavaDoc property page.

See also: Productivity! Tools, Customizing Productivity!