Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Influence generated method names for boolean attributes
Influence generated method names for boolean attributes [message #870204] Mon, 07 May 2012 05:13 Go to next message
Eclipse User
Hi EMF experts,
is it possible to influence the names of the generated getter method for
a boolean attribute? The default is, that a "is[AttributeName]" method
is generated. In my special case this method would better be named
"was[AttributeName]ed". Can I specify this anywhere without manually
simulating it by removing this attribute and adding two operations
(getter and setter) to the EClass.

best regards,
Gilbert
Re: Influence generated method names for boolean attributes [message #870403 is a reply to message #870204] Tue, 08 May 2012 00:23 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 24530
Registered: July 2009
Senior Member
Gilbert,

Comments below.

On 07/05/2012 11:13 AM, Gilbert Mirenque wrote:
> Hi EMF experts,
> is it possible to influence the names of the generated getter method for
> a boolean attribute? The default is, that a "is[AttributeName]" method
> is generated. In my special case this method would better be named
> "was[AttributeName]ed".
No, there's no way to influence anything beyond the name.
> Can I specify this anywhere without manually
> simulating it by removing this attribute and adding two operations
> (getter and setter) to the EClass.
No, and if you did that, they'd not be reflectively visible as
features. You might take the approach of suppressing the accessor's
visibility in the API (via annotations as produced by
EcoreUtil.setSuppressedVisibility) and defining operations in the API
that call the generated accessors in the implementation class.
>
> best regards,
> Gilbert
Re: Influence generated method names for boolean attributes [message #870875 is a reply to message #870403] Thu, 10 May 2012 02:57 Go to previous message
Eclipse User
Hi Ed,

> No, and if you did that, they'd not be reflectively visible as
> features. You might take the approach of suppressing the accessor's
> visibility in the API (via annotations as produced by
> EcoreUtil.setSuppressedVisibility) and defining operations in the API
> that call the generated accessors in the implementation class.
Ok, that's an acceptable workaround. Thanks.

best regards,
Gilbert
Previous Topic:Limitation of EObjectContainmentEList
Next Topic:Open SWT Dialog in ResourceSetListener.transactionAboutToCommit()
Goto Forum:
  


Current Time: Sun May 19 19:48:09 EDT 2013

Powered by FUDForum. Page generated in 0.01670 seconds