Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » No Cast in case of templates
No Cast in case of templates [message #615689] Thu, 10 May 2007 23:13
Pradeep is currently offline PradeepFriend
Messages: 54
Registered: July 2009
Member
Hi,

I created a uml primitive type with Map<String, Datum> and assigned it to
content variable in a class.
Now when I convert it to Ecore then to code, I am getting the following
code. If you see the eUnset function there is proper cast but there is none
in eSet function. The compiler is complaining about the same saying it
cannot accept object.

How can I avoid this.

/**

* <!-- begin-user-doc -->

* <!-- end-user-doc -->

* @generated

*/

@SuppressWarnings("unchecked")

@Override

public void eSet(int featureID, Object newValue) {

switch (featureID) {

case NewheadPackage.DATA_MAP__CONTENT:

setContent(newValue);

return;

}

super.eSet(featureID, newValue);

}


/**

* <!-- begin-user-doc -->

* <!-- end-user-doc -->

* @generated

*/

@Override

public void eUnset(int featureID) {

switch (featureID) {

case NewheadPackage.DATA_MAP__CONTENT:

setContent((Map<String, Datum>)null);

return;

}

super.eUnset(featureID);

}
Previous Topic:Metamodel used
Next Topic:Pros and Cons of the uml2 plugin
Goto Forum:
  


Current Time: Fri Apr 19 04:43:05 GMT 2024

Powered by FUDForum. Page generated in 0.01875 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top