Re: [mdr-users] How to create Associations and AssociationEnd?

Martin Matula <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.mdr.user
Message-ID <[email protected]>
Hi Leena,

Leena Borle wrote:

>Hi,
>  I have a requirement in which , I parse the Java source files using
>Antlr and then I am trying to convert these parsed classes into Mof
>model using MDR and JMI. For doing this I am following UML2MOF source
>code (Transform.java). I could create Mofclasses, Operations, class
>attributes etc... But I am stuck with how to create an association and
>AssociationEnd between the class attributes and MofClass.  Can anyone
>guide me on this? 
>
To associate an attribute with a mof class, just add the attribute to 
the contents of that class:

mofClass.getContents().add(attribute)

>And also how is RefAssociation and Association
>interfaces are related, if I do
>   mofModel.refAllAssociations() ... it will returen RefAssociations.
>How do I get Association metaobject from it?
>  
>
Call refMetaObject() on that RefAssociation.
Regards,
Martin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.