|
|
|
Re: EEF generated classes do not compile [message #500905 is a reply to message #500630] |
Mon, 30 November 2009 09:20 |
Sébastien Gandon Messages: 184 Registered: July 2009 |
Senior Member |
|
|
Hi Stéphane,
if this is a matter of data type conversion I would suggest EEF uses the default EMF conversion behaviour.
EMF creates data conversion methods for each Data type when the genmodel is used for generation.
There are 2 methods
createMyDataFromString()
and
convertMyDataToString()
found in the factory implementation class that serves this purpose in EMF genererated code (look at Data Type section in http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/references/overview/EMF.html).
So I would suggest that EEF use the
org.eclipse.emf.ecore.util.EcoreUtil.createFromString(EDataType eDataType,java.lang.String literal)
org.eclipse.emf.ecore.util.EcoreUtil.convertToString(EDataType eDataType, java.lang.Object value)
for converting the Data to and from text.
This would allow for default EEF generation without any error.
SeB.
[quote title=Stephane Bouchet wrote on Fri, 27 November 2009 04:04]This is a multi-part message in MIME format.
--------------010809070708090700020201
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Hi again,
Sorry i just looked to your metamodel and here is the problem :
<eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
lowerBound="1"
eType="#//datatypes/RgbColor"/>
you are trying to map a custom edatatype ( rgbcolor ) with a text. this
is not supported now by EEF.
you can avoid this generated part by replacing your element editor
"background_value" with a "custom element editor". EEF will generates
empty code that needs to be filled by you to handle th mapping manually.
cheers,
[Updated on: Mon, 30 November 2009 09:21] Report message to a moderator
|
|
|
|
|
Re: EEF generated classes do not compile [message #621860 is a reply to message #500630] |
Mon, 30 November 2009 09:20 |
Eclipse User |
|
|
|
Originally posted by: sgandon.nds.com
Hi Stéphane,
if this is a matter of data type conversion I would suggest EEF uses the default EMF conversion behaviour.
EMF creates data conversion methods when the genmodel is used for generation.
There are 2 methods
createMyDataFromString()
and
convertMyDataToString()
found in the factory implementation class that serves this purpose in EMF genererated code (look at Data Type section in http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/references/overview/EMF.html).
So I would suggest that EEF use the
org.eclipse.emf.ecore.util.EcoreUtil.createFromString(EDataT ype eDataType,java.lang.String literal)
org.eclipse.emf.ecore.util.EcoreUtil.convertToString(EDataTy pe eDataType, java.lang.Object value)
for converting the Data to and from text.
This would allow for default EEF generation without any error.
SeB.
[quote title=Stephane Bouchet wrote on Fri, 27 November 2009 04:04]This is a multi-part message in MIME format.
--------------010809070708090700020201
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Hi again,
Sorry i just looked to your metamodel and here is the problem :
<eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
lowerBound="1"
eType="#//datatypes/RgbColor"/>
you are trying to map a custom edatatype ( rgbcolor ) with a text. this
is not supported now by EEF.
you can avoid this generated part by replacing your element editor
"background_value" with a "custom element editor". EEF will generates
empty code that needs to be filled by you to handle th mapping manually.
cheers,
|
|
|
|
Powered by
FUDForum. Page generated in 0.04685 seconds