Problem during code generation with xtend2 [message #719931] |
Mon, 29 August 2011 13:48 |
Chandan Messages: 12 Registered: July 2011 Location: Zurich |
Junior Member |
|
|
Hi,
I have created a metamodel,a .ecore(sample.ecore) file then a model file(My1.sample) out of it.
I have written an Xtend2 template where I'm reading the model file to generate java code out of it. I'm able to read what has been specified in the model except for the attribute 'valueType' (see TypedFeature class in the ecore file).
For complete code generation I need to know the java instance class name equivalent to the one specified for the attribute 'valueType' in the model file, so have written something like this in the template file(Mytemplate.xtend): «e.valueType.instanceClassName»
But the value is null. So the generated java file looks like this :
public class ClientAccount {
private closingDate ;
private profit ;
}
I dont know where I'm doing wrong. So all which is missing in the generated file is the datatype I'm expecting Date for closingDate and BigDecimal for profit.
Al the files mentioned above are attached. Any help here would be appreciated.
~Chandan
[Updated on: Thu, 01 September 2011 08:26] Report message to a moderator
|
|
|
Re: Problem during code generation with xtend2 [message #723917 is a reply to message #719931] |
Fri, 09 September 2011 21:03 |
|
Hi,
the problem are the strange uris for the refs to ecore in your model file.
change it to
and it will work
<?xml version="1.0" encoding="UTF-8"?>
<sample:Category xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:sample="http://www.sample.emf" name="ClientAccount">
<features xsi:type="sample:Value" name="closingDate">
<valueType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EDate"/>
</features>
<features xsi:type="sample:Value" name="profit">
<valueType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBigDecimal"/>
</features>
</sample:Category>
~Christian
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Powered by
FUDForum. Page generated in 0.02875 seconds