Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » [EEF] Compilation with XMLTypePackage.eINSTANCE.getName() - Converter Utils don't expect a String O
|
Re: [EEF] Compilation with XMLTypePackage.eINSTANCE.getName() - Converter Utils don't expect a Stri [message #548630 is a reply to message #548614] |
Thu, 22 July 2010 14:06 |
Stephane Bouchet Messages: 280 Registered: July 2009 |
Senior Member |
|
|
Hi Christophe,
Sound like a generation bug.
You should open a bug on bugzilla, and attach there a reproductible set
of models ( ecore + eef models ) if possible.
Dou you create your own EDatatype ?
Le 22/07/2010 15:27, Christophe Bouhier a écrit :
> Hi there,
>
> I am trying EEF on my model, I can generate the EEF genmodel.
> I made a new plugin project, and added the dependencies.
>
> I get interresting compilation error on a model Type which has the name
> "Name".
>
> As an example. (There are many!)
> On the following code in i.e. xxxPropertiesEdititionComponent.java
>
>
> if (NetworksPackage.eINSTANCE.getCountry_Name().equals(msg.getF eature())
> && basePart != null){
> if (msg.getNewValue() != null) {
> basePart.setName(EcoreUtil.convertToString(XMLTypePackage.eI NSTANCE.getName(),
> msg.getNewValue()));
> } else {
> basePart.setName("");
> }
> }
>
> Compilation Error:
>
> "The method ECoreUtil.converToString in the type ECoreUtil is not
> applicable for the arguments (String, String)."
>
>
> I Suspect, the code generation should handle features with a name "Name"
> differently. The XMLTypePackage actually defines the feature with an
> additional underscore "_", so getName_()
>
>
> /**
> * Returns the meta object for data type '{@link java.lang.String
> <em>Name</em>}'.
> * <!-- begin-user-doc -->
> * <!-- end-user-doc -->
> * @return the meta object for data type '<em>Name</em>'.
> * @see java.lang.String
> * @model instanceClass="java.lang.String"
> * extendedMetaData="name='Name' baseType='token' pattern='\\i\\c*'"
> * @generated
> */
> EDataType getName_();
>
>
> Cheers Christophe
>
>
>
>
--
Cheers,
Stéphane Bouchet, OBEO
|
|
|
Re: [EEF] Compilation with XMLTypePackage.eINSTANCE.getName() - Converter Utils don't expect a Stri [message #548662 is a reply to message #548614] |
Thu, 22 July 2010 15:03 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
Guys,
Comments below.
Christophe Bouhier wrote:
> Hi there,
>
> I am trying EEF on my model, I can generate the EEF genmodel.
> I made a new plugin project, and added the dependencies.
>
> I get interresting compilation error on a model Type which has the
> name "Name".
>
> As an example. (There are many!)
> On the following code in i.e. xxxPropertiesEdititionComponent.java
>
>
> if
> (NetworksPackage.eINSTANCE.getCountry_Name().equals(msg.getF eature())
> && basePart != null){
Note that when a Literals interface is generated,
NetworksPackage.Literals.COUNTRY__NAME == msg.getFeature() would be more
efficient.
> if (msg.getNewValue() != null) {
>
> basePart.setName(EcoreUtil.convertToString(XMLTypePackage.eI NSTANCE.getName(),
> msg.getNewValue()));
Similarly NetworksPackage.Literals.NAME could be generated. In any
case, genFeature.getFeatureAccessorName() should be used in the template
so that getName_ will be call. Note that getName will return the name
of the package.
> } else {
> basePart.setName("");
> }
> }
>
> Compilation Error:
>
> "The method ECoreUtil.converToString in the type ECoreUtil is not
> applicable for the arguments (String, String)."
>
>
> I Suspect, the code generation should handle features with a name
> "Name" differently. The XMLTypePackage actually defines the feature
> with an additional underscore "_", so getName_()
>
>
> /**
> * Returns the meta object for data type '{@link java.lang.String
> <em>Name</em>}'.
> * <!-- begin-user-doc -->
> * <!-- end-user-doc -->
> * @return the meta object for data type '<em>Name</em>'.
> * @see java.lang.String
> * @model instanceClass="java.lang.String"
> * extendedMetaData="name='Name' baseType='token'
> pattern='\\i\\c*'"
> * @generated
> */
> EDataType getName_();
>
>
> Cheers Christophe
>
>
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: [EEF] Compilation with XMLTypePackage.eINSTANCE.getName() - Converter Utils don't expect a Stri [message #548747 is a reply to message #548630] |
Thu, 22 July 2010 19:47 |
Christophe Bouhier Messages: 937 Registered: July 2009 |
Senior Member |
|
|
See inline;
Stéphane Bouchet wrote:
> Hi Christophe,
>
> Sound like a generation bug.
>
> You should open a bug on bugzilla, and attach there a reproductible set
> of models ( ecore + eef models ) if possible.
Yes I will.
> Dou you create your own EDatatype ?
>
No, I don't think I do. I define simple and complex types in .xsd and
read those in. Simple types might become new EDatatypes, not sure actually.
>
> Le 22/07/2010 15:27, Christophe Bouhier a écrit :
>> Hi there,
>>
>> I am trying EEF on my model, I can generate the EEF genmodel.
>> I made a new plugin project, and added the dependencies.
>>
>> I get interresting compilation error on a model Type which has the name
>> "Name".
>>
>> As an example. (There are many!)
>> On the following code in i.e. xxxPropertiesEdititionComponent.java
>>
>>
>> if (NetworksPackage.eINSTANCE.getCountry_Name().equals(msg.getF eature())
>> && basePart != null){
>> if (msg.getNewValue() != null) {
>> basePart.setName(EcoreUtil.convertToString(XMLTypePackage.eI NSTANCE.getName(),
>>
>> msg.getNewValue()));
>> } else {
>> basePart.setName("");
>> }
>> }
>>
>> Compilation Error:
>>
>> "The method ECoreUtil.converToString in the type ECoreUtil is not
>> applicable for the arguments (String, String)."
>>
>>
>> I Suspect, the code generation should handle features with a name "Name"
>> differently. The XMLTypePackage actually defines the feature with an
>> additional underscore "_", so getName_()
>>
>>
>> /**
>> * Returns the meta object for data type '{@link java.lang.String
>> <em>Name</em>}'.
>> * <!-- begin-user-doc -->
>> * <!-- end-user-doc -->
>> * @return the meta object for data type '<em>Name</em>'.
>> * @see java.lang.String
>> * @model instanceClass="java.lang.String"
>> * extendedMetaData="name='Name' baseType='token' pattern='\\i\\c*'"
>> * @generated
>> */
>> EDataType getName_();
>>
>>
>> Cheers Christophe
>>
>>
>>
>>
>
>
|
|
|
Re: [EEF] Compilation with XMLTypePackage.eINSTANCE.getName() - Converter Utils don't expect a Stri [message #548823 is a reply to message #548662] |
Fri, 23 July 2010 08:12 |
Stephane Bouchet Messages: 280 Registered: July 2009 |
Senior Member |
|
|
Thanks Ed for your hints, indeed that is the correct way to generates code.
we will integrate hopefully this pathc to next release.
Le 22/07/2010 17:03, Ed Merks a écrit :
> Guys,
>
> Comments below.
>
>
> Christophe Bouhier wrote:
>> Hi there,
>>
>> I am trying EEF on my model, I can generate the EEF genmodel.
>> I made a new plugin project, and added the dependencies.
>>
>> I get interresting compilation error on a model Type which has the
>> name "Name".
>>
>> As an example. (There are many!)
>> On the following code in i.e. xxxPropertiesEdititionComponent.java
>>
>>
>> if
>> (NetworksPackage.eINSTANCE.getCountry_Name().equals(msg.getF eature())
>> && basePart != null){
> Note that when a Literals interface is generated,
> NetworksPackage.Literals.COUNTRY__NAME == msg.getFeature() would be more
> efficient.
>> if (msg.getNewValue() != null) {
>> basePart.setName(EcoreUtil.convertToString(XMLTypePackage.eI NSTANCE.getName(),
>> msg.getNewValue()));
> Similarly NetworksPackage.Literals.NAME could be generated. In any case,
> genFeature.getFeatureAccessorName() should be used in the template so
> that getName_ will be call. Note that getName will return the name of
> the package.
>> } else {
>> basePart.setName("");
>> }
>> }
>>
>> Compilation Error:
>>
>> "The method ECoreUtil.converToString in the type ECoreUtil is not
>> applicable for the arguments (String, String)."
>>
>>
>> I Suspect, the code generation should handle features with a name
>> "Name" differently. The XMLTypePackage actually defines the feature
>> with an additional underscore "_", so getName_()
>>
>>
>> /**
>> * Returns the meta object for data type '{@link java.lang.String
>> <em>Name</em>}'.
>> * <!-- begin-user-doc -->
>> * <!-- end-user-doc -->
>> * @return the meta object for data type '<em>Name</em>'.
>> * @see java.lang.String
>> * @model instanceClass="java.lang.String"
>> * extendedMetaData="name='Name' baseType='token' pattern='\\i\\c*'"
>> * @generated
>> */
>> EDataType getName_();
>>
>>
>> Cheers Christophe
>>
>>
>>
>>
--
Cheers,
Stéphane Bouchet, OBEO
|
|
|
Re: [EEF] Compilation with XMLTypePackage.eINSTANCE.getName() - Converter Utils don't expect a Stri [message #623067 is a reply to message #548614] |
Thu, 22 July 2010 14:06 |
Stephane Bouchet Messages: 280 Registered: July 2009 |
Senior Member |
|
|
Hi Christophe,
Sound like a generation bug.
You should open a bug on bugzilla, and attach there a reproductible set
of models ( ecore + eef models ) if possible.
Dou you create your own EDatatype ?
Le 22/07/2010 15:27, Christophe Bouhier a écrit :
> Hi there,
>
> I am trying EEF on my model, I can generate the EEF genmodel.
> I made a new plugin project, and added the dependencies.
>
> I get interresting compilation error on a model Type which has the name
> "Name".
>
> As an example. (There are many!)
> On the following code in i.e. xxxPropertiesEdititionComponent.java
>
>
> if (NetworksPackage.eINSTANCE.getCountry_Name().equals(msg.getF eature())
> && basePart != null){
> if (msg.getNewValue() != null) {
> basePart.setName(EcoreUtil.convertToString(XMLTypePackage.eI NSTANCE.getName(),
> msg.getNewValue()));
> } else {
> basePart.setName("");
> }
> }
>
> Compilation Error:
>
> "The method ECoreUtil.converToString in the type ECoreUtil is not
> applicable for the arguments (String, String)."
>
>
> I Suspect, the code generation should handle features with a name "Name"
> differently. The XMLTypePackage actually defines the feature with an
> additional underscore "_", so getName_()
>
>
> /**
> * Returns the meta object for data type '{@link java.lang.String
> <em>Name</em>}'.
> * <!-- begin-user-doc -->
> * <!-- end-user-doc -->
> * @return the meta object for data type '<em>Name</em>'.
> * @see java.lang.String
> * @model instanceClass="java.lang.String"
> * extendedMetaData="name='Name' baseType='token' pattern='\\i\\c*'"
> * @generated
> */
> EDataType getName_();
>
>
> Cheers Christophe
>
>
>
>
--
Cheers,
Stéphane Bouchet, OBEO
|
|
|
Re: [EEF] Compilation with XMLTypePackage.eINSTANCE.getName() - Converter Utils don't expect a Stri [message #623068 is a reply to message #548614] |
Thu, 22 July 2010 15:03 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
Guys,
Comments below.
Christophe Bouhier wrote:
> Hi there,
>
> I am trying EEF on my model, I can generate the EEF genmodel.
> I made a new plugin project, and added the dependencies.
>
> I get interresting compilation error on a model Type which has the
> name "Name".
>
> As an example. (There are many!)
> On the following code in i.e. xxxPropertiesEdititionComponent.java
>
>
> if
> (NetworksPackage.eINSTANCE.getCountry_Name().equals(msg.getF eature())
> && basePart != null){
Note that when a Literals interface is generated,
NetworksPackage.Literals.COUNTRY__NAME == msg.getFeature() would be more
efficient.
> if (msg.getNewValue() != null) {
>
> basePart.setName(EcoreUtil.convertToString(XMLTypePackage.eI NSTANCE.getName(),
> msg.getNewValue()));
Similarly NetworksPackage.Literals.NAME could be generated. In any
case, genFeature.getFeatureAccessorName() should be used in the template
so that getName_ will be call. Note that getName will return the name
of the package.
> } else {
> basePart.setName("");
> }
> }
>
> Compilation Error:
>
> "The method ECoreUtil.converToString in the type ECoreUtil is not
> applicable for the arguments (String, String)."
>
>
> I Suspect, the code generation should handle features with a name
> "Name" differently. The XMLTypePackage actually defines the feature
> with an additional underscore "_", so getName_()
>
>
> /**
> * Returns the meta object for data type '{@link java.lang.String
> <em>Name</em>}'.
> * <!-- begin-user-doc -->
> * <!-- end-user-doc -->
> * @return the meta object for data type '<em>Name</em>'.
> * @see java.lang.String
> * @model instanceClass="java.lang.String"
> * extendedMetaData="name='Name' baseType='token'
> pattern='\\i\\c*'"
> * @generated
> */
> EDataType getName_();
>
>
> Cheers Christophe
>
>
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: [EEF] Compilation with XMLTypePackage.eINSTANCE.getName() - Converter Utils don't expect a Stri [message #623069 is a reply to message #548630] |
Thu, 22 July 2010 19:47 |
Christophe Bouhier Messages: 937 Registered: July 2009 |
Senior Member |
|
|
See inline;
Stéphane Bouchet wrote:
> Hi Christophe,
>
> Sound like a generation bug.
>
> You should open a bug on bugzilla, and attach there a reproductible set
> of models ( ecore + eef models ) if possible.
Yes I will.
> Dou you create your own EDatatype ?
>
No, I don't think I do. I define simple and complex types in .xsd and
read those in. Simple types might become new EDatatypes, not sure actually.
>
> Le 22/07/2010 15:27, Christophe Bouhier a écrit :
>> Hi there,
>>
>> I am trying EEF on my model, I can generate the EEF genmodel.
>> I made a new plugin project, and added the dependencies.
>>
>> I get interresting compilation error on a model Type which has the name
>> "Name".
>>
>> As an example. (There are many!)
>> On the following code in i.e. xxxPropertiesEdititionComponent.java
>>
>>
>> if (NetworksPackage.eINSTANCE.getCountry_Name().equals(msg.getF eature())
>> && basePart != null){
>> if (msg.getNewValue() != null) {
>> basePart.setName(EcoreUtil.convertToString(XMLTypePackage.eI NSTANCE.getName(),
>>
>> msg.getNewValue()));
>> } else {
>> basePart.setName("");
>> }
>> }
>>
>> Compilation Error:
>>
>> "The method ECoreUtil.converToString in the type ECoreUtil is not
>> applicable for the arguments (String, String)."
>>
>>
>> I Suspect, the code generation should handle features with a name "Name"
>> differently. The XMLTypePackage actually defines the feature with an
>> additional underscore "_", so getName_()
>>
>>
>> /**
>> * Returns the meta object for data type '{@link java.lang.String
>> <em>Name</em>}'.
>> * <!-- begin-user-doc -->
>> * <!-- end-user-doc -->
>> * @return the meta object for data type '<em>Name</em>'.
>> * @see java.lang.String
>> * @model instanceClass="java.lang.String"
>> * extendedMetaData="name='Name' baseType='token' pattern='\\i\\c*'"
>> * @generated
>> */
>> EDataType getName_();
>>
>>
>> Cheers Christophe
>>
>>
>>
>>
>
>
|
|
|
Re: [EEF] Compilation with XMLTypePackage.eINSTANCE.getName() - Converter Utils don't expect a Stri [message #623070 is a reply to message #548662] |
Fri, 23 July 2010 08:12 |
Stephane Bouchet Messages: 280 Registered: July 2009 |
Senior Member |
|
|
Thanks Ed for your hints, indeed that is the correct way to generates code.
we will integrate hopefully this pathc to next release.
Le 22/07/2010 17:03, Ed Merks a écrit :
> Guys,
>
> Comments below.
>
>
> Christophe Bouhier wrote:
>> Hi there,
>>
>> I am trying EEF on my model, I can generate the EEF genmodel.
>> I made a new plugin project, and added the dependencies.
>>
>> I get interresting compilation error on a model Type which has the
>> name "Name".
>>
>> As an example. (There are many!)
>> On the following code in i.e. xxxPropertiesEdititionComponent.java
>>
>>
>> if
>> (NetworksPackage.eINSTANCE.getCountry_Name().equals(msg.getF eature())
>> && basePart != null){
> Note that when a Literals interface is generated,
> NetworksPackage.Literals.COUNTRY__NAME == msg.getFeature() would be more
> efficient.
>> if (msg.getNewValue() != null) {
>> basePart.setName(EcoreUtil.convertToString(XMLTypePackage.eI NSTANCE.getName(),
>> msg.getNewValue()));
> Similarly NetworksPackage.Literals.NAME could be generated. In any case,
> genFeature.getFeatureAccessorName() should be used in the template so
> that getName_ will be call. Note that getName will return the name of
> the package.
>> } else {
>> basePart.setName("");
>> }
>> }
>>
>> Compilation Error:
>>
>> "The method ECoreUtil.converToString in the type ECoreUtil is not
>> applicable for the arguments (String, String)."
>>
>>
>> I Suspect, the code generation should handle features with a name
>> "Name" differently. The XMLTypePackage actually defines the feature
>> with an additional underscore "_", so getName_()
>>
>>
>> /**
>> * Returns the meta object for data type '{@link java.lang.String
>> <em>Name</em>}'.
>> * <!-- begin-user-doc -->
>> * <!-- end-user-doc -->
>> * @return the meta object for data type '<em>Name</em>'.
>> * @see java.lang.String
>> * @model instanceClass="java.lang.String"
>> * extendedMetaData="name='Name' baseType='token' pattern='\\i\\c*'"
>> * @generated
>> */
>> EDataType getName_();
>>
>>
>> Cheers Christophe
>>
>>
>>
>>
--
Cheers,
Stéphane Bouchet, OBEO
|
|
|
Goto Forum:
Current Time: Fri Apr 26 01:20:09 GMT 2024
Powered by FUDForum. Page generated in 0.03407 seconds
|