Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF generated code and MVC pattern customization
EMF generated code and MVC pattern customization [message #1413833] Fri, 29 August 2014 14:35 Go to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
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 as I want to create a Controller interface class where public methods will be provided for setting different properties of different class. So from outside package, it will be not possible to access setters.

do changing access levels for setter cause any problem....? specially if i would like to generate Edit and editor code as well.

Cheers,
Re: EMF generated code and MVC pattern customization [message #1413889 is a reply to message #1413833] Fri, 29 August 2014 17:25 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30541
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,
Previous Topic:[CDO] Old class cast exception resurfaces
Next Topic:CDO integrate in Eclipse Luna
Goto Forum:
  


Current Time: Mon Oct 14 15:49:58 GMT 2019

Powered by FUDForum. Page generated in 0.01989 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top