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.
Summary: | Support private (non-JSON) state in @Model classes | ||
---|---|---|---|
Product: | platform | Reporter: | Jaroslav Tulach <jtulach> |
Component: | Html4j | Assignee: | Jaroslav Tulach <jtulach> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | apireviews |
Priority: | P3 | Keywords: | API_REVIEW_FAST |
Version: | 8.2 | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Attachments: | Model.instance = true to keep private state |
Description
Jaroslav Tulach
2015-12-07 22:26:08 UTC
Created attachment 157706 [details]
Model.instance = true to keep private state
Please review, thanks in advance for your comments. In your example in the diff, you don't show, how/if the value can be initialized/injected. Can you show if/how that's done? It cannot be injected. The implementation class (the one annotated by @Model) needs to have accessible default constructor. That constructor is used to create the instance. Obviously such constructor does not have any parameters, so no initialization is possible. Later one can, however, call any @ModelOperation method and pass in additional configuration parameters. I can put the previous paragraph into Javadoc, it may be a common question. Explanation added: http://source.apidesign.org/hg/html~html4j/rev/558934b8b835 Unless there are objections, I integrate the change on Monday. |