Package org.eclipse.emf.ecore.resource

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


    ResourceSet resourceSet = new ResourceSetImpl();
    Resource umlMetamodel = resourceSet.createResource(
        InterpreterTest.resolveURI(URI.createURI("file://input/Metamodel_uml.ecore")));
    if(!umlMetamodel.isLoaded()){
      log.debug("Loading Parameter-metamodel" + umlMetamodel.getURI().toString());
      umlMetamodel.load(Collections.EMPTY_MAP);
      while(!umlMetamodel.isLoaded()){
        Thread.yield();
      }
      log.debug("isLoaded");
    }
View Full Code Here


            {
              try
              {
                InputStream inputStream = resourceSet.getURIConverter().createInputStream(uri);
                resolvedResource = getResource(uri, resourceSet);
                resolvedResource.load(inputStream, resourceSet.getLoadOptions());
              }
              catch (IOException exception)
              {
                // It is generally not an error to fail to resolve.
                // If a resource is actually created,
View Full Code Here

    // cache
    includesMap.put(include, resource);

    InputStream in = new ByteArrayInputStream(resources.get(numInclude++).toByteArray());
   
    resource.load(in, resourceSet.getLoadOptions());

    // Transformations
    TranslationUnit trunit = (TranslationUnit) resource.getContents().get(0);
    ExpressionEvaluator.evaluate(trunit);
    ArrayExpander.expand(trunit);
View Full Code Here

        //FacesConfigResourceFactory.register(tempFile.toURI().toString());
        Resource resource = factory.createResource(URI.createFileURI(tempFile.getAbsolutePath()));
       
        try {
                    if (resource != null) {
                        resource.load(Collections.EMPTY_MAP);
            EList resourceContents = resource.getContents();
            if (resourceContents != null && resourceContents.size() > 0) {
                result = (FacesConfigType)resourceContents.get(0);
            }
          }
View Full Code Here

      throw new RuntimeException("Missing serialized package: " + packageFilename);
    }
    URI uri = URI.createURI(url.toString());
    Resource resource = new EcoreResourceFactoryImpl().createResource(uri);
    try {
      resource.load(null);
    }
    catch (IOException exception) {
      throw new WrappedException(exception);
    }
    initializeFromLoadedEPackage(this, (EPackage)resource.getContents().get(0));
View Full Code Here

      throw new RuntimeException("Missing serialized package: " + packageFilename);
    }
    URI uri = URI.createURI(url.toString());
    Resource resource = new EcoreResourceFactoryImpl().createResource(uri);
    try {
      resource.load(null);
    }
    catch (IOException exception) {
      throw new WrappedException(exception);
    }
    initializeFromLoadedEPackage(this, (EPackage)resource.getContents().get(0));
View Full Code Here

      {
         TypeHelperImpl th = (TypeHelperImpl)((SDOObjectInputStream)objectInput).getHelperContext().getTypeHelper();
         map = new HashMap();
         map.put("EXTENDED_META_DATA", th.getExtendedMetaData());
      }
      resource.load(new ByteArrayInputStream(bytes), map);
      eDataGraph = (DataGraphImpl)resource.getContents().get(0);
    }

    protected ResourceSet createResourceSet()
    {
View Full Code Here

      throw new RuntimeException("Missing serialized package: " + packageFilename);
    }
    URI uri = URI.createURI(url.toString());
    Resource resource = new EcoreResourceFactoryImpl().createResource(uri);
    try {
      resource.load(null);
    }
    catch (IOException exception) {
      throw new WrappedException(exception);
    }
    initializeFromLoadedEPackage(this, (EPackage)resource.getContents().get(0));
View Full Code Here

      {
         TypeHelperImpl th = (TypeHelperImpl)((SDOObjectInputStream)objectInput).getHelperContext().getTypeHelper();
         map = new HashMap();
         map.put("EXTENDED_META_DATA", th.getExtendedMetaData());
      }
      resource.load(new ByteArrayInputStream(bytes), map);
      eDataGraph = (DataGraphImpl)resource.getContents().get(0);
    }

    protected ResourceSet createResourceSet()
    {
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

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.