Home » Modeling » Epsilon » EOL and feature maps
EOL and feature maps [message #629719] |
Wed, 29 September 2010 11:13 |
Hallvard Traetteberg Messages: 673 Registered: July 2009 Location: Trondheim, Norway |
Senior Member |
|
|
Hi,
I'm using ETL/EOL in the context of an XHTML model (from a QVTO example
I found a reference to). This model uses FeatureMaps heavily and I'm now
struggling with the EOL for adding elements.
If I understand this correctly, a feature map is a way of storing a list
of entry elements, so that the values of the entries also appear in a
set of derived features. In the XHTML model, a Block contains a groups
FeatureMap, and there are derived multi-value references named p, h1,
.... When you add a P to the Block, I believe you have to create an
Entry, set the key to Block's p feature and the value to the new P. Then
the Entry is added to the FeatureMap. There is a convenience method in
FeatureMap for adding the key, value pair. In any case, I have to be
able to get hold of an EPackage instance and ask for a specific
EStructuralFeature, e.g. XhtmlPackage.eINSTANCE.getBlock_P();
I haven't found a way of calling static methods, but know about Native
technique. The question is, do I have to define a new Tool with my own
methods for accessing "static" information, like the EPackage registry?
Hallvard
|
|
|
Re: EOL and feature maps [message #629912 is a reply to message #629719] |
Wed, 29 September 2010 21:54 |
Hallvard Traetteberg Messages: 673 Registered: July 2009 Location: Trondheim, Norway |
Senior Member |
|
|
Hi,
I managed to solve it, twice in fact. First, I implemented a tool that
exposed necessary method for handling FeatureMaps, and used this by
initializing it in a pre block and using it when needed. Second, I
realized that I only needed methods on objects I already had access to
by means of eClass(). E.g. I could lookup features in the eClass, get
feature values, add values to features maps, etc, using only EOL.
:-)
Hallvard
On 29.09.10 13.13, Hallvard Trætteberg wrote:
>
> I'm using ETL/EOL in the context of an XHTML model (from a QVTO example
> I found a reference to). This model uses FeatureMaps heavily and I'm now
> struggling with the EOL for adding elements.
>
> If I understand this correctly, a feature map is a way of storing a list
> of entry elements, so that the values of the entries also appear in a
> set of derived features. In the XHTML model, a Block contains a groups
> FeatureMap, and there are derived multi-value references named p, h1,
> ... When you add a P to the Block, I believe you have to create an
> Entry, set the key to Block's p feature and the value to the new P. Then
> the Entry is added to the FeatureMap. There is a convenience method in
> FeatureMap for adding the key, value pair. In any case, I have to be
> able to get hold of an EPackage instance and ask for a specific
> EStructuralFeature, e.g. XhtmlPackage.eINSTANCE.getBlock_P();
>
> I haven't found a way of calling static methods, but know about Native
> technique. The question is, do I have to define a new Tool with my own
> methods for accessing "static" information, like the EPackage registry?
>
> Hallvard
|
|
|
Re: EOL and feature maps [message #629986 is a reply to message #629912] |
Thu, 30 September 2010 08:03 |
Dimitrios Kolovos Messages: 1776 Registered: July 2009 |
Senior Member |
|
|
Hi Hallvard,
Glad you managed to solve this! For XML-based models you may also want
to have a look at the plain XML driver we recently added to Epsilon:
http://www.eclipse.org/gmt/epsilon/doc/articles/plain-xml/
Cheers,
Dimitris
Hallvard Trætteberg wrote:
> Hi,
>
> I managed to solve it, twice in fact. First, I implemented a tool that
> exposed necessary method for handling FeatureMaps, and used this by
> initializing it in a pre block and using it when needed. Second, I
> realized that I only needed methods on objects I already had access to
> by means of eClass(). E.g. I could lookup features in the eClass, get
> feature values, add values to features maps, etc, using only EOL.
>
> :-)
>
> Hallvard
>
> On 29.09.10 13.13, Hallvard Trætteberg wrote:
>>
>> I'm using ETL/EOL in the context of an XHTML model (from a QVTO example
>> I found a reference to). This model uses FeatureMaps heavily and I'm now
>> struggling with the EOL for adding elements.
>>
>> If I understand this correctly, a feature map is a way of storing a list
>> of entry elements, so that the values of the entries also appear in a
>> set of derived features. In the XHTML model, a Block contains a groups
>> FeatureMap, and there are derived multi-value references named p, h1,
>> ... When you add a P to the Block, I believe you have to create an
>> Entry, set the key to Block's p feature and the value to the new P. Then
>> the Entry is added to the FeatureMap. There is a convenience method in
>> FeatureMap for adding the key, value pair. In any case, I have to be
>> able to get hold of an EPackage instance and ask for a specific
>> EStructuralFeature, e.g. XhtmlPackage.eINSTANCE.getBlock_P();
>>
>> I haven't found a way of calling static methods, but know about Native
>> technique. The question is, do I have to define a new Tool with my own
>> methods for accessing "static" information, like the EPackage registry?
>>
>> Hallvard
>
|
|
| |
Goto Forum:
Current Time: Fri Apr 19 23:22:39 GMT 2024
Powered by FUDForum. Page generated in 0.03177 seconds
|