« Return to Thread: Problem with using generated implementation

Re: Problem with using generated implementation

by Richard Ciglansky :: Rate this Message:

Reply to Author | View in Thread

SauerM wrote:

>Hi All,
>I am trying to use MDR to create and modify Java models. I have MOF metamodel. I have generated interfaces. I loaded the metamodel into MDRepository. I have instance of model, where I can use factories to create new items in model. But when I try to call some method on these items I get this exception: java.lang.AbstractMethodError: org.netbeans.jmi.javamodel.JavaClass$Impl.getSimpleName()Ljava/lang/String;
>  
>
It seems that you are accessing "derived" attribute, marked as "derived"
in metamodel.
Derived attributes and associations must be implemented explicitely
using mechanism described on "mdr" documentation pages as "custom
implementation of methods" or under similar name.

Hope this helps

Richard Ciglansky

>here is part of the code:
>
>        repository.createExtent("java");
>        RefPackage mof = repository.getExtent("java");
>        ExtentUtil.readXMIToExtent("java.xml",mof); //loads metamodel
>        Collection c = ((ModelPackage) mof).getMofPackage().refAllOfClass();
>        Iterator it = c.iterator(); //first item is JavaModel
>        ModelElement model = (ModelElement) it.next();
>        repository.createExtent("model",model);
>        JavaModelPackage p = (JavaModelPackage) repository.getExtent("model");
>        JavaClassClass classFactory = p.getJavaClass();
>        JavaClass testClass = classFactory.createJavaClass();
>        testClass.setSimpleName("test"); // here I get the exception
>
>Could you please give me some hint? I really don't know what's the problem.
>Thank you very much.
>Martin Sauer.
>
>  
>

 « Return to Thread: Problem with using generated implementation