/** * Computes a map so that plugins in the workspace will override those in the target platform or the environment * and so that plugins with Ecore and GenModels in the target platform or the environment will look like projects in the workspace. * It's implemented like this: *<pre> * return computePlatformURIMap(false); *</pre> * @deprecated since 2.9; * use {@link #computePlatformURIMap(boolean) computePlatformURIMap(true)} * to get the mappings for the target platform, * or use {@link #computePlatformURIMap(boolean) computePlatformURIMap(false)} to get the legacy behavior, i.e., the mappings for the installed environment. * It's generally expected that all clients, will migrate to use the target platform. * @return computes a map so that plugins in the workspace will override those in the environment * and so that plugins with Ecore and GenModels will look like projects in the workspace. * @see org.eclipse.emf.ecore.resource.URIConverter#getURIMap() * @see #computePlatformPluginToPlatformResourceMap() * @see #computePlatformResourceToPlatformPluginMap(Collection) */ @Deprecated public static Map<URI, URI> computePlatformURIMap() { return computePlatformURIMap(false); }
/** * Computes a map so that plugins in the workspace will override those in the target platform or the environment * and so that plugins with Ecore and GenModels in the target platform or the environment will look like projects in the workspace. * It's implemented like this: *<pre> * return computePlatformURIMap(false); *</pre> * @deprecated since 2.9; * use {@link #computePlatformURIMap(boolean) computePlatformURIMap(true)} * to get the mappings for the target platform, * or use {@link #computePlatformURIMap(boolean) computePlatformURIMap(false)} to get the legacy behavior, i.e., the mappings for the installed environment. * It's generally expected that all clients, will migrate to use the target platform. * @return computes a map so that plugins in the workspace will override those in the environment * and so that plugins with Ecore and GenModels will look like projects in the workspace. * @see org.eclipse.emf.ecore.resource.URIConverter#getURIMap() * @see #computePlatformPluginToPlatformResourceMap() * @see #computePlatformResourceToPlatformPluginMap(Collection) */ @Deprecated public static Map<URI, URI> computePlatformURIMap() { return computePlatformURIMap(false); }
public static ResourceSet createResourceSet() { ResourceSet result = new ResourceSetImpl(); result.getURIConverter().getURIMap().putAll(EcorePlugin.computePlatformURIMap(true)); return result; }
@Before public void setUp() throws Exception { resourceSet = new XtextResourceSet(); resourceSet.getURIConverter().getURIMap().putAll(EcorePlugin.computePlatformURIMap(false)); resourceSet.getLoadOptions().put(XMLResource.OPTION_URI_HANDLER, this); }
protected Map<URI, URI> computePlatformURIMap(IJavaProject javaProject) { HashMap<URI, URI> hashMap = newHashMap(); try { hashMap.putAll(EcorePlugin.computePlatformURIMap(false)); } catch (Exception e) { LOG.error(e.getMessage(), e);
editingDomain.getResourceSet().getURIConverter().getURIMap().putAll(EcorePlugin.computePlatformURIMap());
resourceSet.getURIConverter().getURIMap().putAll(EcorePlugin.computePlatformURIMap()); URI ecoreURI = URI.createFileURI(ecorePath.toString()); Resource resource = resourceSet.getResource(ecoreURI, true); resourceSet.getURIConverter().getURIMap().putAll(EcorePlugin.computePlatformURIMap()); URI genModelURI = URI.createFileURI(new File(genModelName).getAbsoluteFile().getCanonicalPath()); Resource genModelResource = resourceSet.getResource(genModelURI, true);
resourceSet.getURIConverter().getURIMap().putAll(EcorePlugin.computePlatformURIMap(true)); URI ecoreURI = URI.createFileURI(ecorePath.toString()); Resource resource = resourceSet.getResource(ecoreURI, true); resourceSet.getURIConverter().getURIMap().putAll(EcorePlugin.computePlatformURIMap(true)); URI genModelURI = genModelName.startsWith("platform:/resource/") ? URI.createURI(genModelName) : URI.createFileURI(new File(genModelName).getAbsoluteFile().getCanonicalPath()); Resource genModelResource = resourceSet.getResource(genModelURI, true);
resourceSet.getURIConverter().getURIMap().putAll(EcorePlugin.computePlatformURIMap()); URI uri = getEcorePackage().eResource().getURI().trimSegments(1).appendSegment(getPrefix() + type + ".xsd"); Resource xsdSchemaResource = resourceSet.createResource(uri);
resourceSet.getURIConverter().getURIMap().putAll(EcorePlugin.computePlatformURIMap(true)); URI uri = getEcorePackage().eResource().getURI().trimSegments(1).appendSegment(getPrefix() + type + ".xsd"); Resource xsdSchemaResource = resourceSet.createResource(uri);