How to Load JavaModel (file.javaxmi) [message #982753] |
Tue, 13 November 2012 11:46 |
Rafael Durelli Messages: 72 Registered: September 2012 |
Member |
|
|
Hello guys bonjour, I have read two or three topics closely related to this. However, I couldn't figured out yet how to load a file .javaxmi correctly. In the bellow chunk of source code I have been tried to load a .javaxmi file which was discovered by MoDiSCO, but I haven't succeeded yet. The problem is when I try to make some Cast Operation..For instance, see the bellow code...
JavaapplicationPackage.eINSTANCE.eClass();
JavaPackage.eINSTANCE.eClass();
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().
put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl());
ResourceSet resSet = new ResourceSetImpl();
Resource resource = resSet.getResource(URI.createURI("file:/path/TestModisco.javaxmi"), true);
resource.load(null);
EcoreUtil.resolveAll(resSet);
ModelImpl model = (ModelImpl)resource.getContents().get(0);
//I always get an error during the Cast Operation...
JavaApplication javaVari = (JavaApplication)resource.getContents().get(0);
I always get a error during the Cast Operation. Thus, I would like to know how to obtain the "classes", "methods" and even "variable declaration" after loaded the javaxmi model? Please, I'll be so glad to see an example. Thanks in advance.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02748 seconds