| 
| [EMF] Serialization with jackson in XMI file [message #1768331] | Mon, 17 July 2017 11:03  |  | 
| Eclipse User  |  |  |  |  | Hello, 
 I am trying to save EObjects in an XMI file. It works fine with simple EObjects.
 But I have some EObjects that are more specific.
 
 I have one EClass "TestModel" that has only one attribute, tagged as ID and of type "TestType".
 The EDataType "TestType" has also only one attribute. I use jackson to serialize and deserialize "TestType". So, the serialized value of the EDataType is like : {"attribute":"value"}
 
 This EObject is correctly put in the XMI file :
 <model:TestModel testAttribute="{"attribute":"value"}"/>
 The character '"' (quote) is replaced by : "
 The EObject is also correctly loaded from the XMI file.
 
 But when I create a reference between this EObject and another EObject ("ReferenceToTestModel"), I have the following result :
 <model:ReferenceToTestModel relation="{"attribute":"value"}"/>
 The character '"' (quote) is not replaced in the XMI file. The format of the file is not correct anymore.
 
 I have added the following options when saving the EObjects in the XMI file :
 * OPTION_USE_ENCODED_ATTRIBUTE_STYLE to Boolean.TRUE
 * OPTION_SKIP_ESCAPE_URI to Boolean.FALSE
 Doing this has solved the issue but I would like to be sure that this is the correct solution.
 
 Thanks in advance.
 
 Cyril
 |  |  |  | 
|  | 
Powered by 
FUDForum. Page generated in 0.03603 seconds