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


    }

    public static DataGraph loadDataGraph(InputStream inputStream, Map options) throws IOException {
        ResourceSet resourceSet = DataObjectUtil.createResourceSet();
        Resource resource = resourceSet.createResource(URI.createURI("all.datagraph"));
        resource.load(inputStream, options);
        return (DataGraph)resource.getContents().get(0);
    }

    static final Object LOADING_SCOPE = XMLResource.OPTION_EXTENDED_META_DATA;
View Full Code Here

    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(
        "xmi", UMLResource.Factory.INSTANCE);
    UMLResourcesUtil.init(RESOURCE_SET); // MDT/UML2 4.0.0 (Juno)
    Resource resource = RESOURCE_SET.createResource(uri);
    try {
      resource.load(null);
    } catch (IOException ioe) {
      err(ioe.getMessage());
    }
    out("successfully loaded \'" + uri + "\' :\t" + resource.getContents().size() + " toplevel EObjects found"); //$NON-NLS-1$
    return (EList<? extends EObject>) resource.getContents();
View Full Code Here

        ActivityTestCaseGraphPackage.eINSTANCE);
    ActivityTestCaseGraphResourceFactoryImpl tcgResourceFactory = new ActivityTestCaseGraphResourceFactoryImpl();
    Resource res = tcgResourceFactory.createResource(URI
        .createFileURI(inFile));
    try {
      res.load(null);
    } catch (IOException e) {
      e.printStackTrace();
    }
    TCGActivity tcgActivity = (TCGActivity) res.getContents().get(0);
    EList<Path> paths = PathSearch.BFS.findAllPaths(tcgActivity);
View Full Code Here

    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(
        "xmi", UMLResource.Factory.INSTANCE);
    UMLResourcesUtil.init(RESOURCE_SET); // MDT/UML2 4.0.0 (Juno)
    Resource resource = RESOURCE_SET.createResource(uri);
    try {
      resource.load(null);
    } catch (IOException ioe) {
      err(ioe.getMessage());
    }
    out("successfully loaded \'" + uri + "\' :\t" + resource.getContents().size() + " toplevel EObjects found"); //$NON-NLS-1$
    return (EList<? extends EObject>) resource.getContents();
View Full Code Here

    readCmdArgs(args);
    RESOURCE_SET.getPackageRegistry().put("http://org.xilaew.atg.model.activityTestCaseGraph", ActivityTestCaseGraphPackage.eINSTANCE );
    ActivityTestCaseGraphResourceFactoryImpl tcgResourceFactory = new ActivityTestCaseGraphResourceFactoryImpl();
    Resource res = tcgResourceFactory.createResource(URI.createFileURI(inFile));
    try {
      res.load(null);
    } catch (IOException e) {
      e.printStackTrace();
    }
    TCGActivity tcgActivity = (TCGActivity) res.getContents().get(0);
    String amplModel = ActTCG2AMPLModel.transform(tcgActivity);
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

    Resource resource = rs.getResource(fileURI, true);

    try {

      resource.load(Collections.EMPTY_MAP);

      ByteArrayOutputStream os = new ByteArrayOutputStream();

      Map<Object, Object> optionsMap = new LinkedHashMap<Object, Object>();
View Full Code Here

    Resource resource = rs.getResource(fileURI, true);

    try {

      resource.load(Collections.EMPTY_MAP);

      ByteArrayOutputStream os = new ByteArrayOutputStream();

      Map<Object, Object> optionsMap = new LinkedHashMap<Object, Object>();
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.