I wrote a simple program to save a class diagram to a uml file. After
that I can read the elements such as Class in the uml
file using the following code:
if(resource.getContents().get(i) instanceof Model)
{
System.out.println("Model name is " + ((Model) resource.getContents().get(i)).getName());
}
else if (resource.getContents().get(i) instanceof Class)
System.out.println("Class name is " + ((Class) resource.getContents().get(i)).getName());
....
But when I try to load the UML Metamodel from the Superstructure.uml file, the above code failed. When I check Superstructure.uml, I find this file is different from the
uml file where I saved a class model created using UML2 api. The element in my created uml file is like UML:MetaClass such as UML:Class while Superstructure.uml has elements whose name is PackagedElement... In this case, how Superstructure.uml is created? It does not seem to be created by ECore... How can I read Superstructure.uml? Thanks.
Wuwei