Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » How to customize name of Java enum
How to customize name of Java enum [message #686720] Thu, 12 May 2011 10:47 Go to next message
Daniel Selman is currently offline Daniel SelmanFriend
Messages: 14
Registered: July 2009
Junior Member
Does anyone know how to customize the name of generated enum classes? I
have found the "Class / Interface Name Pattern" genmodel properties and
need something similar for enums. I am using EMF 2.6.

Thanks!
Dan
Re: How to customize name of Java enum [message #686722 is a reply to message #686720] Thu, 12 May 2011 13:17 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Dan,

There's no support for that. The only reason someone added the
class/interface thing is so they could produce IFoo/Foo instead of
Foo/FooImpl (and not be forced to end up with IFoo/IFooImpl just to get
the interface name they want). What are you hoping to accomplish in
terms of enum naming? It's hard to imagine a compelling reason why an
EEnum named Foo in Ecore shouldn't simply produce a enum named Foo in
Java...


Daniel Selman wrote:
> Does anyone know how to customize the name of generated enum classes?
> I have found the "Class / Interface Name Pattern" genmodel properties
> and need something similar for enums. I am using EMF 2.6.
>
> Thanks!
> Dan


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How to customize name of Java enum [message #686723 is a reply to message #686722] Thu, 12 May 2011 13:45 Go to previous messageGo to next message
Daniel Selman is currently offline Daniel SelmanFriend
Messages: 14
Registered: July 2009
Junior Member
Ed,

For legacy reasons all the classes/interfaces in our public API are
prefixed by "Ilr". I will see if we can loosen this restriction for
newly generated enums...

Thanks,
Dan

On 5/12/11 3:17 PM, Ed Merks wrote:
> Dan,
>
> There's no support for that. The only reason someone added the
> class/interface thing is so they could produce IFoo/Foo instead of
> Foo/FooImpl (and not be forced to end up with IFoo/IFooImpl just to get
> the interface name they want). What are you hoping to accomplish in
> terms of enum naming? It's hard to imagine a compelling reason why an
> EEnum named Foo in Ecore shouldn't simply produce a enum named Foo in
> Java...
>
>
> Daniel Selman wrote:
>> Does anyone know how to customize the name of generated enum classes?
>> I have found the "Class / Interface Name Pattern" genmodel properties
>> and need something similar for enums. I am using EMF 2.6.
>>
>> Thanks!
>> Dan
Re: How to customize name of Java enum [message #686724 is a reply to message #686723] Thu, 12 May 2011 14:07 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Dan,

So you're trying to get EMF to produce "the same thing" as some
previously handed coded API?

In the worst case, you could given the EEnum itself that (horrible)
name...

Is the "I" in "Ilr" meaning the same thing as the "I" in something like
"IResource", i.e., it means that it's an interface? Or is "Ilr"
something like a short name?


Daniel Selman wrote:
> Ed,
>
> For legacy reasons all the classes/interfaces in our public API are
> prefixed by "Ilr". I will see if we can loosen this restriction for
> newly generated enums...
>
> Thanks,
> Dan
>
> On 5/12/11 3:17 PM, Ed Merks wrote:
>> Dan,
>>
>> There's no support for that. The only reason someone added the
>> class/interface thing is so they could produce IFoo/Foo instead of
>> Foo/FooImpl (and not be forced to end up with IFoo/IFooImpl just to get
>> the interface name they want). What are you hoping to accomplish in
>> terms of enum naming? It's hard to imagine a compelling reason why an
>> EEnum named Foo in Ecore shouldn't simply produce a enum named Foo in
>> Java...
>>
>>
>> Daniel Selman wrote:
>>> Does anyone know how to customize the name of generated enum classes?
>>> I have found the "Class / Interface Name Pattern" genmodel properties
>>> and need something similar for enums. I am using EMF 2.6.
>>>
>>> Thanks!
>>> Dan
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How to customize name of Java enum [message #686725 is a reply to message #686724] Thu, 12 May 2011 15:49 Go to previous messageGo to next message
Daniel Selman is currently offline Daniel SelmanFriend
Messages: 14
Registered: July 2009
Junior Member
Ed,

"Ilr" is a just an abbreviation -- it has no real significance in terms
of software development. What would I need to go to override EMF's
naming of the generated Java enum?

Dan

On 5/12/11 4:07 PM, Ed Merks wrote:
> Dan,
>
> So you're trying to get EMF to produce "the same thing" as some
> previously handed coded API?
>
> In the worst case, you could given the EEnum itself that (horrible) name...
> Is the "I" in "Ilr" meaning the same thing as the "I" in something like
> "IResource", i.e., it means that it's an interface? Or is "Ilr"
> something like a short name?
>
>
> Daniel Selman wrote:
>> Ed,
>>
>> For legacy reasons all the classes/interfaces in our public API are
>> prefixed by "Ilr". I will see if we can loosen this restriction for
>> newly generated enums...
>>
>> Thanks,
>> Dan
>>
>> On 5/12/11 3:17 PM, Ed Merks wrote:
>>> Dan,
>>>
>>> There's no support for that. The only reason someone added the
>>> class/interface thing is so they could produce IFoo/Foo instead of
>>> Foo/FooImpl (and not be forced to end up with IFoo/IFooImpl just to get
>>> the interface name they want). What are you hoping to accomplish in
>>> terms of enum naming? It's hard to imagine a compelling reason why an
>>> EEnum named Foo in Ecore shouldn't simply produce a enum named Foo in
>>> Java...
>>>
>>>
>>> Daniel Selman wrote:
>>>> Does anyone know how to customize the name of generated enum classes?
>>>> I have found the "Class / Interface Name Pattern" genmodel properties
>>>> and need something similar for enums. I am using EMF 2.6.
>>>>
>>>> Thanks!
>>>> Dan
>>
Re: How to customize name of Java enum [message #686726 is a reply to message #686725] Thu, 12 May 2011 15:51 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Dan,

Why isn't renaming the EEnum itself sufficient?


Daniel Selman wrote:
> Ed,
>
> "Ilr" is a just an abbreviation -- it has no real significance in
> terms of software development. What would I need to go to override
> EMF's naming of the generated Java enum?
>
> Dan
>
> On 5/12/11 4:07 PM, Ed Merks wrote:
>> Dan,
>>
>> So you're trying to get EMF to produce "the same thing" as some
>> previously handed coded API?
>>
>> In the worst case, you could given the EEnum itself that (horrible)
>> name...
>> Is the "I" in "Ilr" meaning the same thing as the "I" in something like
>> "IResource", i.e., it means that it's an interface? Or is "Ilr"
>> something like a short name?
>>
>>
>> Daniel Selman wrote:
>>> Ed,
>>>
>>> For legacy reasons all the classes/interfaces in our public API are
>>> prefixed by "Ilr". I will see if we can loosen this restriction for
>>> newly generated enums...
>>>
>>> Thanks,
>>> Dan
>>>
>>> On 5/12/11 3:17 PM, Ed Merks wrote:
>>>> Dan,
>>>>
>>>> There's no support for that. The only reason someone added the
>>>> class/interface thing is so they could produce IFoo/Foo instead of
>>>> Foo/FooImpl (and not be forced to end up with IFoo/IFooImpl just to
>>>> get
>>>> the interface name they want). What are you hoping to accomplish in
>>>> terms of enum naming? It's hard to imagine a compelling reason why an
>>>> EEnum named Foo in Ecore shouldn't simply produce a enum named Foo in
>>>> Java...
>>>>
>>>>
>>>> Daniel Selman wrote:
>>>>> Does anyone know how to customize the name of generated enum classes?
>>>>> I have found the "Class / Interface Name Pattern" genmodel properties
>>>>> and need something similar for enums. I am using EMF 2.6.
>>>>>
>>>>> Thanks!
>>>>> Dan
>>>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How to customize name of Java enum [message #686879 is a reply to message #686720] Thu, 12 May 2011 13:17 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Dan,

There's no support for that. The only reason someone added the
class/interface thing is so they could produce IFoo/Foo instead of
Foo/FooImpl (and not be forced to end up with IFoo/IFooImpl just to get
the interface name they want). What are you hoping to accomplish in
terms of enum naming? It's hard to imagine a compelling reason why an
EEnum named Foo in Ecore shouldn't simply produce a enum named Foo in
Java...


Daniel Selman wrote:
> Does anyone know how to customize the name of generated enum classes?
> I have found the "Class / Interface Name Pattern" genmodel properties
> and need something similar for enums. I am using EMF 2.6.
>
> Thanks!
> Dan


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How to customize name of Java enum [message #686880 is a reply to message #686722] Thu, 12 May 2011 13:45 Go to previous message
Daniel Selman is currently offline Daniel SelmanFriend
Messages: 14
Registered: July 2009
Junior Member
Ed,

For legacy reasons all the classes/interfaces in our public API are
prefixed by "Ilr". I will see if we can loosen this restriction for
newly generated enums...

Thanks,
Dan

On 5/12/11 3:17 PM, Ed Merks wrote:
> Dan,
>
> There's no support for that. The only reason someone added the
> class/interface thing is so they could produce IFoo/Foo instead of
> Foo/FooImpl (and not be forced to end up with IFoo/IFooImpl just to get
> the interface name they want). What are you hoping to accomplish in
> terms of enum naming? It's hard to imagine a compelling reason why an
> EEnum named Foo in Ecore shouldn't simply produce a enum named Foo in
> Java...
>
>
> Daniel Selman wrote:
>> Does anyone know how to customize the name of generated enum classes?
>> I have found the "Class / Interface Name Pattern" genmodel properties
>> and need something similar for enums. I am using EMF 2.6.
>>
>> Thanks!
>> Dan
Re: How to customize name of Java enum [message #686881 is a reply to message #686723] Thu, 12 May 2011 14:07 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Dan,

So you're trying to get EMF to produce "the same thing" as some
previously handed coded API?

In the worst case, you could given the EEnum itself that (horrible)
name...

Is the "I" in "Ilr" meaning the same thing as the "I" in something like
"IResource", i.e., it means that it's an interface? Or is "Ilr"
something like a short name?


Daniel Selman wrote:
> Ed,
>
> For legacy reasons all the classes/interfaces in our public API are
> prefixed by "Ilr". I will see if we can loosen this restriction for
> newly generated enums...
>
> Thanks,
> Dan
>
> On 5/12/11 3:17 PM, Ed Merks wrote:
>> Dan,
>>
>> There's no support for that. The only reason someone added the
>> class/interface thing is so they could produce IFoo/Foo instead of
>> Foo/FooImpl (and not be forced to end up with IFoo/IFooImpl just to get
>> the interface name they want). What are you hoping to accomplish in
>> terms of enum naming? It's hard to imagine a compelling reason why an
>> EEnum named Foo in Ecore shouldn't simply produce a enum named Foo in
>> Java...
>>
>>
>> Daniel Selman wrote:
>>> Does anyone know how to customize the name of generated enum classes?
>>> I have found the "Class / Interface Name Pattern" genmodel properties
>>> and need something similar for enums. I am using EMF 2.6.
>>>
>>> Thanks!
>>> Dan
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How to customize name of Java enum [message #686882 is a reply to message #686724] Thu, 12 May 2011 15:49 Go to previous message
Daniel Selman is currently offline Daniel SelmanFriend
Messages: 14
Registered: July 2009
Junior Member
Ed,

"Ilr" is a just an abbreviation -- it has no real significance in terms
of software development. What would I need to go to override EMF's
naming of the generated Java enum?

Dan

On 5/12/11 4:07 PM, Ed Merks wrote:
> Dan,
>
> So you're trying to get EMF to produce "the same thing" as some
> previously handed coded API?
>
> In the worst case, you could given the EEnum itself that (horrible) name...
> Is the "I" in "Ilr" meaning the same thing as the "I" in something like
> "IResource", i.e., it means that it's an interface? Or is "Ilr"
> something like a short name?
>
>
> Daniel Selman wrote:
>> Ed,
>>
>> For legacy reasons all the classes/interfaces in our public API are
>> prefixed by "Ilr". I will see if we can loosen this restriction for
>> newly generated enums...
>>
>> Thanks,
>> Dan
>>
>> On 5/12/11 3:17 PM, Ed Merks wrote:
>>> Dan,
>>>
>>> There's no support for that. The only reason someone added the
>>> class/interface thing is so they could produce IFoo/Foo instead of
>>> Foo/FooImpl (and not be forced to end up with IFoo/IFooImpl just to get
>>> the interface name they want). What are you hoping to accomplish in
>>> terms of enum naming? It's hard to imagine a compelling reason why an
>>> EEnum named Foo in Ecore shouldn't simply produce a enum named Foo in
>>> Java...
>>>
>>>
>>> Daniel Selman wrote:
>>>> Does anyone know how to customize the name of generated enum classes?
>>>> I have found the "Class / Interface Name Pattern" genmodel properties
>>>> and need something similar for enums. I am using EMF 2.6.
>>>>
>>>> Thanks!
>>>> Dan
>>
Re: How to customize name of Java enum [message #686883 is a reply to message #686725] Thu, 12 May 2011 15:51 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Dan,

Why isn't renaming the EEnum itself sufficient?


Daniel Selman wrote:
> Ed,
>
> "Ilr" is a just an abbreviation -- it has no real significance in
> terms of software development. What would I need to go to override
> EMF's naming of the generated Java enum?
>
> Dan
>
> On 5/12/11 4:07 PM, Ed Merks wrote:
>> Dan,
>>
>> So you're trying to get EMF to produce "the same thing" as some
>> previously handed coded API?
>>
>> In the worst case, you could given the EEnum itself that (horrible)
>> name...
>> Is the "I" in "Ilr" meaning the same thing as the "I" in something like
>> "IResource", i.e., it means that it's an interface? Or is "Ilr"
>> something like a short name?
>>
>>
>> Daniel Selman wrote:
>>> Ed,
>>>
>>> For legacy reasons all the classes/interfaces in our public API are
>>> prefixed by "Ilr". I will see if we can loosen this restriction for
>>> newly generated enums...
>>>
>>> Thanks,
>>> Dan
>>>
>>> On 5/12/11 3:17 PM, Ed Merks wrote:
>>>> Dan,
>>>>
>>>> There's no support for that. The only reason someone added the
>>>> class/interface thing is so they could produce IFoo/Foo instead of
>>>> Foo/FooImpl (and not be forced to end up with IFoo/IFooImpl just to
>>>> get
>>>> the interface name they want). What are you hoping to accomplish in
>>>> terms of enum naming? It's hard to imagine a compelling reason why an
>>>> EEnum named Foo in Ecore shouldn't simply produce a enum named Foo in
>>>> Java...
>>>>
>>>>
>>>> Daniel Selman wrote:
>>>>> Does anyone know how to customize the name of generated enum classes?
>>>>> I have found the "Class / Interface Name Pattern" genmodel properties
>>>>> and need something similar for enums. I am using EMF 2.6.
>>>>>
>>>>> Thanks!
>>>>> Dan
>>>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:How to customize name of Java enum
Next Topic:(no subject)
Goto Forum:
  


Current Time: Fri Apr 26 16:07:45 GMT 2024

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

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

Back to the top