Skip to content
This repository has been archived by the owner on Jun 26, 2021. It is now read-only.

Possibility to always add the type to EObjects. #110

Open
AlbinTheander opened this issue Jun 25, 2020 · 0 comments
Open

Possibility to always add the type to EObjects. #110

AlbinTheander opened this issue Jun 25, 2020 · 0 comments

Comments

@AlbinTheander
Copy link

Currently I have a use-case where I need to deserialize an array of different types of EObjects into a standard java list. To be able to deal with the generics part of it, I need the type to be serialized in all the objects. (So the deserializer can create the correct EObject subtype.)

Currently there is a function in EObjectTypeProperty.java:

private boolean shouldSaveType(EClass objectType, EClass featureType, EStructuralFeature feature) {
	return objectType != featureType && objectType != EcorePackage.Literals.EOBJECT;
}

I don't know if there is a reason for not including it when the object type is the same as the feature type. I can see how it shouldn't be needed for most cases, but I can't see that it would be a problem to always include it.

I would like to either remove that condition, or add a feature flag to always include the type.

I am fully prepared to try to put together a pull request, but I would like some input on which way to go; removing it or adding a feature flat. (Or possibly tell me that it's already possible and I misunderstood things.)

@AlbinTheander AlbinTheander changed the title Possibility to always add the Always add the type to EObjects. Possibility to always add the type to EObjects. Jul 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant