|
Re: EMF generated code and MVC pattern customization [message #1413889 is a reply to message #1413833] |
Fri, 29 August 2014 17:25 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
Comments below.
On 29/08/2014 4:35 PM, ModelGeek Mising name wrote:
> I would like to customize generated code for MVC pattern. I have an
> ecore and i have generated only code (no edit and editor). In
> generated code all set methods for properties are public and i would
> like to give them package access
That's not possible in an interface. They'd have to be suppressed from
the interface (which you can do with an annotation as produced by
org.eclipse.emf.ecore.util.EcoreUtil.setSuppressedVisibility(EStructuralFeature,
int, boolean)).
> as I want to create a Controller interface class where public methods
> will be provided for setting different properties of different class.
Of course this deals only with single value accessors. For multi-valued
features, the getter provide access to a writeable list.
> So from outside package, it will be not possible to access setters.
Reflectively it will always be possible.
>
> do changing access levels for setter cause any problem....?
It's not clear what you have in mind or why...
> specially if i would like to generate Edit and editor code as well.
I don't really see the point.
>
> Cheers,
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.01718 seconds