|
|
|
|
|
Re: how to extract metamodel specific classes from a model [message #786356 is a reply to message #786318] |
Mon, 30 January 2012 10:10 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Sébastien,
I recall someone else complaining that the option isn't used to help
with decisions for the root element. I thought there was a bugzilla for
it, but I can't find it.
On 30/01/2012 10:09 AM, Sébastien Gandon wrote:
> I have tried it but without success
>
> XMLTypeInfo xmlTypeInfo = new XMLSave.XMLTypeInfo() {
>
> @Override
> public boolean shouldSaveType(EClass objectType, EClass
> featureType, EStructuralFeature feature) {
> return
> feature.getEContainingClass().getEPackage().equals(CommonPackage.eINSTANCE);
> }
>
> @Override
> public boolean shouldSaveType(EClass objectType,
> EClassifier featureType, EStructuralFeature feature) {
> return
> feature.getEContainingClass().getEPackage().equals(CommonPackage.eINSTANCE);
> }
> };
> Map<String, Object> options = new HashMap<String, Object>();
> options.put(XMLResource.OPTION_SAVE_TYPE_INFORMATION,
> xmlTypeInfo);
> resource.save(outputStream, options);
>
> The 2 implemented methods are never called when I serialize my objects.
> When I debug EMF code the method
> org.eclipse.emf.ecore.xmi.impl.XMISaveImpl.writeTopObjects(List<?
> extends EObject>) only calls helper.getQName() and I can't find any
> code for checking if type should be persisted or not and what would be
> it's persisted type.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03248 seconds