This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 194482 - No property for specifying that a method is a Getter or a Setter for an attribute
Summary: No property for specifying that a method is a Getter or a Setter for an attri...
Status: NEW
Alias: None
Product: uml
Classification: Unclassified
Component: Properties (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: issues@uml
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-19 16:21 UTC by cordisvictor
Modified: 2011-01-21 16:49 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description cordisvictor 2011-01-19 16:21:52 UTC
If one models a class:
 - when creating a new private attribute => getter and setter is generated
 - when generating code => the getters and setters are also implemented
 (not just stubs)

If one creates a Class Element from existing code:
 - when generating code => the getters and setters are just stubs

=> this feature isn't being displayed and one cannot set a rev. eng.
   class's attributes to have getters and setters.


Possible solution:

When selecting an attribute, the property list should contain two extra entries:
 1) name="read with"
    value= a combo box with "NONE" + the class methods
           filtered: params.length==0
                     &&
                     return.getClass()==attribute.getClass()
 2) name="write with"
    value= a combo box with "NONE" + the class methods
           filtered: params.length==1
                     &&
                     params[0].getClass()==attribute.getClass()
                     &&
                     return.getClass()==Void.getClass()

=> one can configure the model such that code generation also implements
   the getter and setter stubs.
Comment 1 cordisvictor 2011-01-21 16:49:36 UTC
If "Client changeability" is the option I was talking about then:

1) it does not work (no effect on the generated code)
   eg: I set it to "add only" and expected the getter to be implemented
       and the setter to be not but they still depend on that hidden setting.

2) it should have been "read only" and "write only",
   not "add only" and "remove only"


PS: there is no option to create a constructor neither