Book a Demo

Author Topic: upper letters in getter setter for properties  (Read 4770 times)

GBeutler

  • EA User
  • **
  • Posts: 23
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
upper letters in getter setter for properties
« on: September 07, 2007, 07:13:45 am »
Hi,

if've got a simple code generation problem. I would like to generate code which fullfill the java coding standard.
Let's say the attribute name is foo then EA generates:

int getfoo()

I would like to get a getter (setter) like

int getFoo()

Where and how can I configure this upper letter? I found out that I can modify the prefix at

tools->options->code generation options->java

There the prefix is only 'get' and 'set'. Can I configure upper letters there?

thanks in advance and best regards,

Guido


«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: upper letters in getter setter for properties
« Reply #1 on: September 07, 2007, 09:06:00 am »
Hi Guido,

You've almost got it. The other settings you need are in the Tools | Options | Code Generation page above the Java settings (these options are shared by all languages).

Near the bottom of the page you'll find a text box for listing any prefixes that should be removed before prepending get and set (or whatever you've configured on the Java tab). Just below that box are two checkboxes. The left check box allows you to capitalize the property name; checking that box will do what you want. EA remembers these options once you set them, so future sessiosn will respect your chosen setting. You might also want to check the other box, depending on how you want boolean properties named.

HTH, David
No, you can't have it!

GBeutler

  • EA User
  • **
  • Posts: 23
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: upper letters in getter setter for properties
« Reply #2 on: September 07, 2007, 09:29:17 am »
Hey,

it's working. Thanx David :)

best regards,

Guido  

holmestm

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: upper letters in getter setter for properties
« Reply #3 on: September 12, 2007, 02:17:20 am »
This also ensures that Java code import assigns property method stereotypes properly.

A nice feature would be a concise way of displaying bean properties in class diagrams, perhaps just the name and type with a rw indicator, hiding the getter/setter methods themselves. This would make my class diagrams neater :-)

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: upper letters in getter setter for properties
« Reply #4 on: September 12, 2007, 02:32:10 am »
For the present, check Set Feature Visibility (control-shift-Y with one or more elements selected).

This is pretty blunt, and must be set on a per-diagram or even per-element basis. Still, it's a beginning.

David
No, you can't have it!

holmestm

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: upper letters in getter setter for properties
« Reply #5 on: September 12, 2007, 03:14:19 am »
I'm using Diagram->Properties->Features tab, Visible Class Members then selecting 'Property Methods'.

Feature Options, Show Stereotypes must also be enabled for this to work.

What this does is to group operations that are property setters and getters together. What I'd like is just a list of public properties of that class, which I could achieve by not using property methods and making my attributes public.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: upper letters in getter setter for properties
« Reply #6 on: September 12, 2007, 03:47:47 am »
Not a good idea, since you likely don't want the attributes themselves to be public.
No, you can't have it!