Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Serialization order for attributes
Serialization order for attributes [message #931475] Wed, 03 October 2012 08:37 Go to next message
Daniele Pala is currently offline Daniele PalaFriend
Messages: 9
Registered: September 2011
Junior Member
Hello, I have a basic question: I need to serialize a model to a .csv file (one line for each object, each value corresponds to an attribute), where the order in which attributes are written is important.
By using a simple Iterator for the EAttributes I need to serialize, do I get them in the order in which they are declared in the .ecore file? For example, whith this structure:

<eClassifiers xsi:type="ecore:EClass" name="Load">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="pn" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFloat"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="qn" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFloat"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="#//LoadType"/>
</eClassifiers>

if I iterate over the EAttributes of a "Load" EObject, will I always get them in the order: pn-qn-type? Or the order in which they are returned is random?

Thanks,
Daniele

[Updated on: Wed, 03 October 2012 08:40]

Report message to a moderator

Re: Serialization order for ttributes [message #931824 is a reply to message #931475] Wed, 03 October 2012 15:04 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Daniele,

Yes, you get them in the order in which they appear in the model.

On 03/10/2012 10:37 AM, Daniele Pala wrote:
> Hello, I have a basic question: I need to serialize a model to a .csv
> file (one line for each object, each value corresponds to an
> attribute), where the order in which attributes are written is
> important. By using a simple Iterator for the EAttributes I need to
> serialize, do I get them in the order in which they are declared in
> the .ecore file? For example, whith this structure:
>
> <eClassifiers xsi:type="ecore:EClass" name="Load">
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="pn"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFloat"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="qn"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFloat"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="type"
> eType="#//LoadType"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="node"
> lowerBound="1" eType="#//Node"/>
> </eClassifiers>
>
> if I iterate over the EAttributes of a "Load" EObject, will I always
> get them in the order: pn-qn-type-node? Or the order in which they are
> returned is random?
>
> Thanks,
> Daniele


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[CDO] CDO server with oracle 11g db server
Next Topic:Adapter Factories in standalone mode.
Goto Forum:
  


Current Time: Fri Mar 29 01:41:54 GMT 2024

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

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

Back to the top