View previous topic :: View next topic |
Author |
Message |
bmf1972
Joined: 25 Jan 2005
Posts: 2
|
Posted: Tue Jan 25, 2005 7:45 pm Post subject: Code generation inconsistent with Eclipse settings
|
|
|
Hi all,
I am using EclipseUML v2.0.0..
I have the following settings (in Preferences / Java / Code Style):
field prefix: m_
static field prefix: s_
parameter prefix: p_
local variable prefix: (none)
qualify all generated field accesses with 'this'
When generating code with EclipseUML, parameter names and the field accesses are not generated as specified by above settings.
Thanks for your time,
Adrian.
|
|
Back to top |
|
|
julien
Site Admin
Joined: 16 Mar 2003
Posts: 194
|
Posted: Tue Jan 25, 2005 10:58 pm Post subject: Re: Code generation inconsistent with Eclipse settings
|
|
|
"this" is not a prefix. It is a qualifier. We use it to prevent the name conflit with local variables.
regards
julien
|
|
Back to top |
|
|
bmf1972
Joined: 25 Jan 2005
Posts: 2
|
Posted: Wed Jan 26, 2005 1:02 am Post subject:
|
|
|
Julien,
Thanks for your reply - I will explain my question using an example.
I would like EclipseUML to generate code like this:
class Foo {
private String m_name;
public String getName() {
return this.m_name;
}
public void setName( String p_name ) {
this.m_name = p_name;
}
}
instead it generates:
class Foo {
private String m_name;
public String getName() {
return m_name; // missing 'this'
}
/* parameter generated with member prefix ("m_")
instead of parameter prefix ("p_") */
public void setName( String m_name ) {
this.m_name = m_name;
}
}
Those settings are supported by the Eclipse JDT and it would be nice if EclipseUML, which is a Java generator tool, supported those settings also.
Adrian.
|
|
Back to top |
|
|
julien
Site Admin
Joined: 16 Mar 2003
Posts: 194
|
Posted: Wed Jan 26, 2005 1:20 am Post subject:
|
|
|
I see what you mean. It will be done in the next major release in which we will change the code generation template engine completely with more powerful customization features.
thanks
julien
|
|
Back to top |
|
|
|