@Override protected NotificationChain inverseRemove(E object, NotificationChain notifications) { Resource.Internal resource = (Resource.Internal)object; Map<URI, Resource> map = getURIResourceMap(); if (map != null) { for (Iterator<Resource> i = map.values().iterator(); i.hasNext();) { if (resource == i.next()) { i.remove(); } } } return resource.basicSetResourceSet(null, notifications); }
@Override protected NotificationChain inverseRemove(E object, NotificationChain notifications) { Resource.Internal resource = (Resource.Internal)object; Map<URI, Resource> map = getURIResourceMap(); if (map != null) { for (Iterator<Resource> i = map.values().iterator(); i.hasNext();) { if (resource == i.next()) { i.remove(); } } } return resource.basicSetResourceSet(null, notifications); }
protected boolean isExistingOrRenamedResourceURI(URI uri) { ResourceSet resourceSet = localDescriptions.getResourceSet(); if (resourceSet instanceof ResourceSetImpl) { Map<URI, Resource> map = ((ResourceSetImpl) resourceSet).getURIResourceMap(); boolean result = map.containsKey(uri.trimFragment()); return result; } throw new IllegalStateException("ResourceSet is not a ResourceSetImpl"); }
public EObject getIndexedJvmType(URI javaObjectURI, ResourceSet resourceSet, boolean throwShadowedException) throws UnknownNestedTypeException { if (resourceSet != null) { URI withoutFragment = javaObjectURI.trimFragment(); if (resourceSet instanceof ResourceSetImpl) { // if the resource uri is already available in the resource set, try to find it directly Map<URI, Resource> resourceMap = ((ResourceSetImpl) resourceSet).getURIResourceMap(); if (resourceMap != null && resourceMap.containsKey(withoutFragment)) { EObject result = resourceSet.getEObject(javaObjectURI, true); if (result != null) { return result; } } } String fqn = withoutFragment.segment(withoutFragment.segmentCount() - 1); final String base = fqn; Iterator<String> variants = innerClassNameVariants.variantsFor(base); EObject jvmType = null; while (jvmType == null && variants.hasNext()) { fqn = variants.next(); List<String> fqnSegments = Strings.split(fqn, '.'); QualifiedName qualifiedName = QualifiedName.create(fqnSegments); jvmType = getIndexedJvmType(qualifiedName, javaObjectURI.fragment(), resourceSet, throwShadowedException); } return jvmType; } return null; }
Map<URI, Resource> map = getURIResourceMap(); if (map != null)
Map<URI, Resource> map = getURIResourceMap(); if (map != null)
if (resourceSet instanceof ResourceSetImpl) { Map<URI, Resource> resourceMap = ((ResourceSetImpl) resourceSet).getURIResourceMap(); if (resourceMap != null && resourceMap.containsKey(withoutFragment)) { EObject result = resourceSet.getEObject(javaObjectURI, true);