Re: [mdr-users] continueing . . 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:

>To associate an attribute with a mof class, just add the attribute to 
>the contents of that class:
>
>mofClass.getContents().add(attribute)
>          
>    This solution is fine if an attribute is of type primitive or any
>Java class. But if it is another MofClass(which means user defined
>class or interface), Don't I need to create some kind of
>reference/association between the two classes ?
>  
>
I do not understand what you mean. A MOF attribute can be of MOF type 
only. Regardless of the attribute type, the attributes are added to a 
class the same way I described.

>   This also applies for creating and association between current
>class and its super classes which again will be MofClasses. Hw do I
>achieve this?
>  
>
mofClass.getSupertypes().add(superClass)

or (if there is more than one superclass:

mofClass.getSupertypes().addAll(superClasses)

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.