[EEF] Compilation with XMLTypePackage.eINSTANCE.getName() - Converter Utils don't expect a String O [message #623066] |
Thu, 22 July 2010 13:27 |
Christophe Bouhier Messages: 937 Registered: July 2009 |
Senior Member |
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.02695 seconds