[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Re: Wrapper for arbitrary values or objects

Hi, Ed.
It seems this is exactly what we need.

Thanks a lot.

Best, Philipp

Ed Merks wrote:
Phillip,

An instance of SimpleAnyType is an EObject and can have its setInstanceType be called to reference any EDataType and then setValue or setRawValue can be used to set an instance of that type or a literal representation of an instance of that type so in that way it acts as a wrapper. This is what's created when a serialized instance uses xsi:type="..." where "..." refers to an EDataType rather than an EClass...


Philipp W. Kutter wrote:
Hi.
Has anyone an idea what is the most elegant solution for a
wrapper for values of some EDataYype, and objects of some EClass?

We need to define an EStructuralFeature which can point both to any
EObject, or any of EInt, EBoolean, EString, e.t.c.

Creating a class

Wrapper(type: EType, many: boolean, objectValue: EObject*, intValue: EInt*, ...)

is obvious, but then the OCL expressions over this get very ugly.

Best, Philipp