Exemplo n.º 1
0
 public static @Nullable PivotMetamodelManager findMetamodelManager(@NonNull Resource resource) {
   EnvironmentFactoryInternal environmentFactory = findEnvironmentFactory(resource);
   if (environmentFactory == null) {
     return null;
   }
   return environmentFactory.getMetamodelManager();
 }
Exemplo n.º 2
0
 @Override
 public RootPackageId getMetamodelId(
     @NonNull EnvironmentFactoryInternal environmentFactory, @NonNull EPackage ePackage) {
   assert !"http://www.eclipse.org/uml2/5.0.0/UML".equals(ePackage.getNsURI());
   assert !"http://www.eclipse.org/uml2/5.0.0/Types".equals(ePackage.getNsURI());
   RootPackageId metamodel = null;
   if (ClassUtil.basicGetMetamodelAnnotation(ePackage) != null) {
     metamodel = IdManager.METAMODEL;
   } else {
     String nsURI = ePackage.getNsURI();
     String sharedNsURI = environmentFactory.getCompleteModel().getCompleteURI(nsURI);
     if ((sharedNsURI != null) && !sharedNsURI.equals(nsURI)) {
       metamodel = IdManager.getRootPackageId(sharedNsURI);
     }
   }
   return metamodel;
 }