Skip to main content



      Home
Home » Modeling » EMF » Keep uppercase of the EAttribute names
Keep uppercase of the EAttribute names [message #429419] Wed, 22 April 2009 14:49 Go to next message
Eclipse UserFriend
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 15:06 Go to previous messageGo to next message
Eclipse UserFriend
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!
>
Re: Keep uppercase of the EAttribute names [message #429423 is a reply to message #429420] Wed, 22 April 2009 18:15 Go to previous messageGo to next message
Eclipse UserFriend
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] Wed, 22 April 2009 20:42 Go to previous message
Eclipse UserFriend
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="">
>
Previous Topic:EMF thread safe databindings?
Next Topic:[EMF Databinding]
Goto Forum:
  


Current Time: Sun Jul 13 11:10:04 EDT 2025

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

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

Back to the top