Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » EAnnotation and Cross document reference
EAnnotation and Cross document reference [message #626768] Tue, 08 July 2008 05:59
Sushant Sirsikar is currently offline Sushant SirsikarFriend
Messages: 5
Registered: July 2009
Junior Member
Hi All,
I am working on project which uses cross document reference
functionality of EMF. I have two models
1) UML2.0 model. (Which is uml model created by emf’s tool project)
2) Description model (This model is create using emf to store
description of Uml model).
Both the models are in different resource and using EMF version
2.2. There is one constraint, that I can not change the UML2.0 model
because of dependency with other code.
Now problem is, I need to attach this new “Description” model to
UML2.0 model. I am trying to add this model inside the EMF model using
EAnnotation. EAnnotation has ‘details’ field which returns ECoreEMap,
which delegates to EStringTOStringMap as …

public class EAnnotationImpl extends EModelElementImpl implements
public EMap getDetails()
if (details == null)
details = new
EcoreEMap(EcorePackage.eINSTANCE.getEStringToStringMapEntry( ),
EStringToStringMapEntryImpl.class, this,
return details;

Above is default implementation provided in
org.eclipse.emf.ecore.impl.EAnnotationImpl. Now I want my details contains
map which can take ‘object’ as key and value instead of String which is
provided by EStringTOStringMap. To achieve this I override details()
method as

EAnnotaion annotation = new EAnnotationImpl(){
public EMap getDetails() {
this.details = new
EcoreEMap(Uml2docPackage.eINSTANCE.getObjectMap(), ObjectMapImpl.class,
this, EcorePackage.EANNOTATION__DETAILS);
return this.details;
annotation.setSource(IAnnotationConstants.DOCUMENTATION_SOUR CE);
This details method delegates to ObjectMap which is inside “Description”
model. So when I save my resources, my .uml file looks like bellow :

<?xml version="1.0" encoding="UTF-8"?>
<uml:Model xmi:version="2.0" xmlns:xmi=""
<eAnnotations xmi:id="_0UEsUEvrEd2X0eL_8jpS4A"
<details xmi:id="_0UEsUUvrEd2X0eL_8jpS4A" key="uuid"
-----------Some serialized model-----------------------
<ownedMember xmi:type="uml:UseCase" xmi:id="_yy6bkEvrEd2X0eL_8jpS4A"
<eAnnotations xmi:id="_zlSTsEvrEd2X0eL_8jpS4A"
<eAnnotations xmi:id="_0UEsWEvrEd2X0eL_8jpS4A"
<details xmi:id="_0UEsWUvrEd2X0eL_8jpS4A" key="uuid"
xmi:type="com.zensar.sbp.modelTransformation.model:ObjectMap "
xmi:id="_zlSTsUvrEd2X0eL_8jpS4A" key="documentation">
xmi:type="com.zensar.sbp.modelTransformation.model:Documentation "
<eAnnotations xmi:id="_0UEsVkvrEd2X0eL_8jpS4A"
<details xmi:id="_0UEsV0vrEd2X0eL_8jpS4A" key="uuid"

So my problem is :
1) When I load the uml and description model in resource set, it loads
object map with key but it doesn’t load value, which is cross document
reference to ‘description’ model.
2) What is the way to register my new annotationimpl inside EcoreFactory
and package.? Because when I load uml model, it again creates
EStringToString map and could not store my ObjectMap which in terns gives

Thanks in advance for any suggestion.
Previous Topic:Best way to model arguments of a message?
Next Topic:[Stereotype] isAppliedStereotype differs on JavaDoc and Implementation
Goto Forum:

Current Time: Sat Aug 13 04:12:53 GMT 2022

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

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

Back to the top