Package org.eclipse.emf.ecore.xmi.impl

Examples of org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl


      if (writeEcoreTypeSystem && !isModelGenerated) {
        TypeSystemDescription tsDesc = TypeSystemUtil.typeSystem2TypeSystemDescription(aCas
                .getTypeSystem());
        // register default resource factory
        Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("*",
                new XMIResourceFactoryImpl());
        ResourceSet resourceSet = new ResourceSetImpl();
        URI outputURI = URI.createFileURI(new File(mOutputDir, "typesystem.ecore")
                .getAbsolutePath());
        Resource outputResource = resourceSet.createResource(outputURI);
        schemaLocationMap = new HashMap();
View Full Code Here


   * filename of the Ecore/XMI file to generate.
   */
  public static void main(String[] args) throws Exception {
    // register default resource factory
    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("*",
            new XMIResourceFactoryImpl());

    ResourceSet resourceSet = new ResourceSetImpl();
    URI outputURI = URI.createFileURI(args[1]);
    Resource outputResource = resourceSet.createResource(outputURI);
    Map options = new HashMap();
View Full Code Here

   */
  public static TypeSystemDescription ecore2UimaTypeSystem(String aEcoreFilePath, Map aOptions)
          throws URISyntaxException {
    // register default resource factory
    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("*",
            new XMIResourceFactoryImpl());
    // create resource set to hold the resource we're loading and its dependent resources
    ResourceSet resourceSet = new ResourceSetImpl();
    // convert file path to absolute path -- seems to be required for propery proxy resolution
    File inputFile = new File(aEcoreFilePath);
    URI absoluteInputURI = URI.createFileURI(inputFile.getAbsolutePath());
View Full Code Here

  private static void WriteFile(EObject eObject, String fileName) {
    // create resource set and resource
    ResourceSet resourceSet = new ResourceSetImpl();

    // Register XML resource factory
    resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xmi", new XMIResourceFactoryImpl());

    Resource resource = resourceSet.createResource(URI.createFileURI(fileName));
   
    resource.getContents().add(eObject);
   
View Full Code Here

  public static EObject ReadFile(String fileName){
    // create resource set and resource
    ResourceSet resourceSet = new ResourceSetImpl();

    // Register XML resource factory
    resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xmi", new XMIResourceFactoryImpl());

    URI uri = URI.createFileURI(fileName);
    Resource resource = resourceSet.createResource(uri);
   
    // register package in local resource registry
View Full Code Here

    primaryObject.eResource().save(out, null);

    ResourceSet testResourceSet = createResourceSet();

    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));
  }
View Full Code Here

    {
      ResourceSet testResourceSet = createResourceSet();

      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));
    }
View Full Code Here

    {
      ResourceSet testResourceSet = createResourceSet();

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

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

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

  public void testExtrinsicIDs() throws IOException
  {
    // Setup : Create a target object and set its extrinsic ID

    ResourceSet resourceSet = createResourceSet();
    resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl()
    {
      @Override
      public Resource createResource(URI uri)
      {
        return new XMIResourceImpl(uri)
View Full Code Here

   
    // Register the appropriate resource factory to handle all file extensions.
    //
    resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put
      (Resource.Factory.Registry.DEFAULT_EXTENSION,
       new XMIResourceFactoryImpl());

    // Register the package to ensure it is available during loading.
    //
    resourceSet.getPackageRegistry().put
      (Fd2Package.eNS_URI,
View Full Code Here

TOP

Related Classes of org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl

Copyright © 2018 www.massapicom. 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.