Package org.eclipse.emf.ecore.resource

Examples of org.eclipse.emf.ecore.resource.Resource.load()


          try {
            Map options = new HashMap(GMFResourceFactory
                .getDefaultLoadOptions());
            // @see 171060
            // options.put(org.eclipse.emf.ecore.xmi.XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE);
            resource.load(options);
          } catch (IOException e) {
            resource.unload();
            throw e;
          }
        }
View Full Code Here


    // register package in local resource registry
    //resourceSet.getPackageRegistry().put(fd2Package.getNsURI(), fd2Package);
   
    try {
      // load resource
      resource.load(null);
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      return null;
    }
View Full Code Here

          try {
            Map options = new HashMap(
                GMFResourceFactory.getDefaultLoadOptions());
            // @see 171060
            // options.put(org.eclipse.emf.ecore.xmi.XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE);
            resource.load(options);
          } catch (IOException e) {
            resource.unload();
            throw e;
          }
        }
View Full Code Here

          try {
            Map options = new HashMap(
                GMFResourceFactory.getDefaultLoadOptions());
            // @see 171060
            // options.put(org.eclipse.emf.ecore.xmi.XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE);
            resource.load(options);
          } catch (IOException e) {
            resource.unload();
            throw e;
          }
        }
View Full Code Here

          try {
            Map options = new HashMap(
                GMFResourceFactory.getDefaultLoadOptions());
            // @see 171060
            // options.put(org.eclipse.emf.ecore.xmi.XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE);
            resource.load(options);
          } catch (IOException e) {
            resource.unload();
            throw e;
          }
        }
View Full Code Here

          try {
            Map options = new HashMap(
                GMFResourceFactory.getDefaultLoadOptions());
            // @see 171060
            // options.put(org.eclipse.emf.ecore.xmi.XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE);
            resource.load(options);
          } catch (IOException e) {
            resource.unload();
            throw e;
          }
        }
View Full Code Here

    testResourceSet.getURIConverter().getURIMap().put(URI.createURI("../TargetObject/"), targetObject1.eResource().getURI().trimSegments(1).appendSegment(""));
    Resource libraryXMI = new XMIResourceFactoryImpl().createResource(URI.createURI(temporaryFolder.newFile("model.xmi").getAbsolutePath()));
    testResourceSet.getResources().add(libraryXMI);

    libraryXMI.load(new ByteArrayInputStream(out.toByteArray()), null);
    EChecker.checkObject(primaryObject, libraryXMI.getContents().get(0));
  }

  @Test
  public void testBinaryRepresentation() throws IOException
View Full Code Here

      testResourceSet.getURIConverter().getURIMap().put(URI.createURI("../TargetObject/"), targetObject1.eResource().getURI().trimSegments(1).appendSegment(""));

      Resource libraryBinary = new BinaryResourceImpl(URI.createURI(temporaryFolder.newFile("model.binary").getAbsolutePath()));
      testResourceSet.getResources().add(libraryBinary);

      libraryBinary.load(new ByteArrayInputStream(out.toByteArray()), null);
      EChecker.checkObject(primaryObject, libraryBinary.getContents().get(0));
    }
    {
      ResourceSet testResourceSet = createResourceSet();
View Full Code Here

      testResourceSet.getURIConverter().getURIMap().put(URI.createURI("../TargetObject/"), targetObject1.eResource().getURI().trimSegments(1).appendSegment(""));

      Resource libraryXMI = new XMIResourceFactoryImpl().createResource(URI.createURI(temporaryFolder.newFile("model.mongo.binary").getAbsolutePath()));
      testResourceSet.getResources().add(libraryXMI);

      libraryXMI.load(new ByteArrayInputStream(out.toByteArray()), options);
      EChecker.checkObject(primaryObject, libraryXMI.getContents().get(0));
    }
  }

  @Test
View Full Code Here

      testResourceSet.getURIConverter().getURIMap().put(URI.createURI("../TargetObject/"), targetObject1.eResource().getURI().trimSegments(1).appendSegment(""));

      Resource libraryXML = new XMLResourceFactoryImpl().createResource(URI.createURI(temporaryFolder.newFile("model.xml").getAbsolutePath()));
      testResourceSet.getResources().add(libraryXML);

      libraryXML.load(new ByteArrayInputStream(out.toByteArray()), null);
      EChecker.checkObject(primaryObject, libraryXML.getContents().get(0));
    }
    {
      ResourceSet testResourceSet = createResourceSet();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.