Package org.eclipse.emf.ecore.resource

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


    } else {
      synchronized(resourceSet) {
        resource.unload();
        try {
          logger.info("Refreshing model '{}'", name);
          resource.load(inputStream, Collections.EMPTY_MAP);
          notifyListeners(name, EventType.MODIFIED);
          return true;
        } catch (IOException e) {
          logger.warn("Configuration model '" + name + "' cannot be parsed correctly!", e);
          resourceSet.getResources().remove(resource);
View Full Code Here


        Resource res = changeSummary.eResource();
        res.unload();

        // apply changes from the event
        try {
            res.load(new ByteArrayInputStream((byte[]) data), null);
            if (SDOPlugin.isTracing(TRACE_TAG)) {
                SDOPlugin.getTraceLog().println("processUpdate:");
                res.save(SDOPlugin.getTraceLog(), null);
            }
        } catch (IOException e) {
View Full Code Here

    Map<String, String> options = Maps.newHashMap();
    options.put(XtextResource.OPTION_ENCODING, getEncodingProvider().getEncoding(uri));

    Resource r = factory.createResource(uri);
    resourceSet.getResources().add(r);
    r.load(in, options);

    return r;
  }

  /**
 
View Full Code Here

  public Resource loadResource(URI uri) throws IOException {
    Resource resource = resourceSet.createResource(uri);
    Map<String, String> options = Maps.newHashMap();
    options.put(XtextResource.OPTION_ENCODING, getEncodingProvider().getEncoding(uri));

    resource.load(options);
    resourceSet.getResources().add(resource);
    return resource;

  }
View Full Code Here

    Map<String, String> options = Maps.newHashMap();
    options.put(XtextResource.OPTION_ENCODING, "UTF8");

    Resource r = factory.createResource(uri);
    resourceSet.getResources().add(r);
    r.load(in, options);

    return r;
  }

  /**
 
View Full Code Here

  public Resource loadResource(URI uri) throws IOException {
    Resource resource = resourceSet.createResource(uri);
    Map<String, String> options = Maps.newHashMap();
    options.put(XtextResource.OPTION_ENCODING, "UTF8");

    resource.load(options);
    resourceSet.getResources().add(resource);
    return resource;
  }

  /**
 
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

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.