public URI getUri() {
   DeployedImportResolver importResolver = DeployedImportResolver.INSTANCE;
   CFile srcFile = importResolver.resolveImport(myId);
   if (srcFile != null) {
     return EmfUtil.makeUri(srcFile.toString());
   }
   return URI.createPlatformPluginURI(myId, false);
 }
예제 #2
0
  @Override
  public EObject create(EClass class_) {
    // return super.create(class_);

    if (myClassifierInitializations.get(class_) == null) {
      cacheClassifierInitExp(class_);
    }

    if (EmfUtil.isAssignableFrom(QvtOperationalStdLibrary.INSTANCE.getExceptionClass(), class_)) {
      return new ExceptionClassInstance(class_);
    } else {
      return new IntermediateClassInstance(class_);
    }
  }
예제 #3
0
 public void testInvalidModel() {
   {
     URI uri = createWorkspaceUri("invalid.ecore"); // $NON-NLS-1$
     assertNotNull(uri);
     assertTrue(EmfUtil.isUriExists(uri, new ResourceSetImpl(), true));
     assertTrue(EmfUtil.isUriExists(uri, new ResourceSetImpl(), false));
     assertFalse(EmfUtil.isUriExistsAsEObject(uri, new ResourceSetImpl(), true));
     assertFalse(EmfUtil.isUriExistsAsEObject(uri, new ResourceSetImpl(), false));
   }
   {
     URI uri = createPlatformUri("invalid.ecore"); // $NON-NLS-1$
     assertNotNull(uri);
     assertTrue(EmfUtil.isUriExists(uri, new ResourceSetImpl(), true));
     assertTrue(EmfUtil.isUriExists(uri, new ResourceSetImpl(), false));
     assertFalse(EmfUtil.isUriExistsAsEObject(uri, new ResourceSetImpl(), true));
     assertFalse(EmfUtil.isUriExistsAsEObject(uri, new ResourceSetImpl(), false));
   }
   {
     URI uri = CustomEmfResourceFactory.createUri(CustomEmfResourceFactory.INVALID_MODEL);
     assertNotNull(uri);
     assertFalse(EmfUtil.isUriExists(uri, new ResourceSetImpl(), true));
     assertFalse(EmfUtil.isUriExists(uri, new ResourceSetImpl(), false));
     assertFalse(EmfUtil.isUriExistsAsEObject(uri, new ResourceSetImpl(), true));
     assertFalse(EmfUtil.isUriExistsAsEObject(uri, new ResourceSetImpl(), false));
   }
 }
 protected boolean isMatchingPackage(final EPackage ePackage, final String packageQuery) {
   return matches(EmfUtil.getFullName(ePackage), packageQuery, false);
 }
예제 #5
0
 public void testNonEmptyModel() {
   {
     URI uri = createWorkspaceUri("nonEmpty.ecore"); // $NON-NLS-1$
     assertNotNull(uri);
     assertTrue(EmfUtil.isUriExists(uri, new ResourceSetImpl(), true));
     assertTrue(EmfUtil.isUriExists(uri, new ResourceSetImpl(), false));
     assertTrue(EmfUtil.isUriExistsAsEObject(uri, new ResourceSetImpl(), true));
     assertTrue(EmfUtil.isUriExistsAsEObject(uri, new ResourceSetImpl(), false));
   }
   {
     URI uri = createPlatformUri("nonEmpty.ecore"); // $NON-NLS-1$
     assertNotNull(uri);
     assertTrue(EmfUtil.isUriExists(uri, new ResourceSetImpl(), true));
     assertTrue(EmfUtil.isUriExists(uri, new ResourceSetImpl(), false));
     assertTrue(EmfUtil.isUriExistsAsEObject(uri, new ResourceSetImpl(), true));
     assertTrue(EmfUtil.isUriExistsAsEObject(uri, new ResourceSetImpl(), false));
   }
   {
     URI uri = CustomEmfResourceFactory.createUri(CustomEmfResourceFactory.NON_EMPTY_MODEL);
     assertNotNull(uri);
     assertTrue(EmfUtil.isUriExists(uri, new ResourceSetImpl(), true));
     assertTrue(EmfUtil.isUriExists(uri, new ResourceSetImpl(), false));
     assertTrue(EmfUtil.isUriExistsAsEObject(uri, new ResourceSetImpl(), true));
     assertTrue(EmfUtil.isUriExistsAsEObject(uri, new ResourceSetImpl(), false));
   }
 }