Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Keep uppercase of the EAttribute names
Keep uppercase of the EAttribute names [message #429419] Wed, 22 April 2009 18:49 Go to next message
AJ  is currently offline AJ Friend
Messages: 77
Registered: July 2009
Member
Hi,

I'm generating my ecore model using an XSD file; which contains elements
with uppercase names like this:

<xs:element name="Analysis" maxOccurs='unbounded'>
<xs:complexType mixed="false">
<xs:sequence>
<xs:element name="ANALYSIS_ID" type="xs:string" />


However, when the ecore model is generated, the first letter of the
EAttribute name is changed to lowercase (e.g. aNALYSISID).

Is there anything I can set/add so EMF keeps everything uppercase?

Thanks in advance!
Re: Keep uppercase of the EAttribute names [message #429420 is a reply to message #429419] Wed, 22 April 2009 19:06 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Ben,

Comments below.

Ben wrote:
> Hi,
>
> I'm generating my ecore model using an XSD file; which contains
> elements with uppercase names like this:
>
> <xs:element name="Analysis" maxOccurs='unbounded'>
> <xs:complexType mixed="false">
> <xs:sequence>
> <xs:element name="ANALYSIS_ID" type="xs:string" />
>
>
> However, when the ecore model is generated, the first letter of the
> EAttribute name is changed to lowercase (e.g. aNALYSISID).
>
> Is there anything I can set/add so EMF keeps everything uppercase?
You could use ecore:name="...". Why does it matter anyway given the
serialization will use exactly the name used in the schema? If
anything, analysisID would be more appropriate Java naming convention
for a field.
>
> Thanks in advance!
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Keep uppercase of the EAttribute names [message #429423 is a reply to message #429420] Wed, 22 April 2009 22:15 Go to previous messageGo to next message
AJ  is currently offline AJ Friend
Messages: 77
Registered: July 2009
Member
Ed,

> Why does it matter anyway given the serialization will use exactly the name
used in the schema?

I'm not sure I follow.

When it is actually serialized, it uses the EAttribute name, as shown
below:

<analysisList>
<analysis aNALYSISID="Z01451" aNALYSISNAME="TIMELINE AMES"
aNALYSISINCREMENTID="">
Re: Keep uppercase of the EAttribute names [message #429426 is a reply to message #429423] Thu, 23 April 2009 00:42 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Ben,

What you show isn't used if you properly use the generated
XyzResourceFactoryImpl to create the resource because in that case the
extended meta data option is applied and the original XML names will
appear in the serialization. After all, XML allows things like
ANALYZED-ID which isn't a valid Java name and that too is supported in
the serialization....


Ben wrote:
> Ed,
>
>> Why does it matter anyway given the serialization will use exactly
>> the name
> used in the schema?
>
> I'm not sure I follow.
>
> When it is actually serialized, it uses the EAttribute name, as shown
> below:
>
> <analysisList>
> <analysis aNALYSISID="Z01451" aNALYSISNAME="TIMELINE AMES"
> aNALYSISINCREMENTID="">
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:EMF thread safe databindings?
Next Topic:[EMF Databinding]
Goto Forum:
  


Current Time: Fri Apr 26 22:07:15 GMT 2024

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

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

Back to the top