@Override public String getURIFragment(EObject eObject) { if (mirror != null) { String result = mirror.getFragment(eObject, fragmentProviderFallback); return result; } return super.getURIFragment(eObject); }
@Override public EObject getEObject(String uriFragment) { if (mirror != null) { EObject result = mirror.getEObject(this, uriFragment, fragmentProviderFallback); return result; } return super.getEObject(uriFragment); }
/** * Returns a newly allocated default resource {@link org.eclipse.emf.ecore.resource.impl.ResourceImpl#ResourceImpl(URI) implementation}. * @param uri the URI. * @return a new resource for the URI. */ public Resource createResource(URI uri) { return new ResourceImpl(uri); } }
public final void unload() { if (isLoaded) { unloadingContents = getUnloadingContents(); Notification notification = setLoaded(false); try { doUnload(); } finally { unloadingContents = null; if (notification != null) { eNotify(notification); } setTimeStamp(URIConverter.NULL_TIME_STAMP); } } }
public void detached(EObject eObject) { if (isAttachedDetachedHelperRequired()) { detachedHelper(eObject); for (TreeIterator<EObject> tree = getAllProperContents(eObject); tree.hasNext(); ) { detachedHelper(tree.next()); } } }
public void attached(EObject eObject) { if (isAttachedDetachedHelperRequired()) { attachedHelper(eObject); for (TreeIterator<EObject> tree = getAllProperContents(eObject); tree.hasNext(); ) { attachedHelper(tree.next()); } } }
/** * Does all the work of unloading the resource. * It calls {@link #unloaded unloaded} for each object it the content {@link #getAllContents tree}, * and clears the {@link #getContents contents}, {@link #getErrors errors}, and {@link #getWarnings warnings}. */ protected void doUnload() { Iterator<EObject> allContents = getAllProperContents(unloadingContents); // This guard is needed to ensure that clear doesn't make the resource become loaded. // if (!getContents().isEmpty()) { getContents().clear(); } getErrors().clear(); getWarnings().clear(); while (allContents.hasNext()) { unloaded((InternalEObject)allContents.next()); } }
public EObject getEObject(String uriFragment) { int length = uriFragment.length(); if (length > 0) { if (uriFragment.charAt(0) == '/') { return getEObject(SegmentSequence.create("/", uriFragment).subSegmentsList(1)); } else if (uriFragment.charAt(length - 1) == '?') { int index = uriFragment.lastIndexOf('?', length - 2); if (index > 0) { uriFragment = uriFragment.substring(0, index); } } } return getEObjectByID(uriFragment); }
modificationTrackingAdapter = createModificationTrackingAdapter(); for (TreeIterator<EObject> i = getAllProperContents(getContents()); i.hasNext(); ) modificationTrackingAdapter = null; for (TreeIterator<EObject> i = getAllProperContents(getContents()); i.hasNext(); ) if (eNotificationRequired()) eNotify(notification);
return getEObjectByID(uriFragmentRootSegment.substring(1)); List<EObject> contents = getContents(); if (position < contents.size() && position >= 0)
@Override protected List<EObject> getUnloadingContents() { return super.getContents(); }
Map<String, EObject> map = getIntrinsicIDToEObjectMap(); if (map != null) for (TreeIterator<EObject> i = getAllProperContents(getContents()); i.hasNext(); )
public void attached(EObject eObject) { super.attached(eObject); // we need to attach a XSDSchemaLocator in order to resolve inline schema locations // if there's not already one attached XSDSchemaLocator xsdSchemaLocator = (XSDSchemaLocator)EcoreUtil.getRegisteredAdapter(this, XSDSchemaLocator.class); if (xsdSchemaLocator == null) { getResourceSet().getAdapterFactories().add(new XSDSchemaLocatorAdapterFactory()); } if (eObject instanceof DefinitionImpl) { DefinitionImpl definition = (DefinitionImpl)eObject; definition.setInlineSchemaLocations(this); } } /*
@Override public NotificationChain inverseAdd(E object, NotificationChain notifications) { InternalEObject eObject = (InternalEObject)object; notifications = eObject.eSetResource(ResourceImpl.this, notifications); ResourceImpl.this.attached(eObject); return notifications; }
@Override protected void detachedHelper(EObject eObject) { if (useIDs() && unloadingContents == null) { if (useUUIDs()) { DETACHED_EOBJECT_TO_ID_MAP.put(eObject, getID(eObject)); } if (idToEObjectMap != null && eObjectToIDMap != null) { setID(eObject, null); } } super.detachedHelper(eObject); }
@Override protected boolean isAttachedDetachedHelperRequired() { return useIDs() || super.isAttachedDetachedHelperRequired(); }
@Override protected EObject getEObjectByID(String id) { if (idToEObjectMap != null) { EObject eObject = idToEObjectMap.get(id); if (eObject != null) { return eObject; } } return super.getEObjectByID(id); }
@Override protected void attachedHelper(EObject eObject) { super.attachedHelper(eObject); String id = getID(eObject); if (id == null) { if (!isLoading()) { id = DETACHED_EOBJECT_TO_ID_MAP.remove(eObject); if (id == null) { id = EcoreUtil.generateUUID(); } setID(eObject, id); } } else { getIDToEObjectMap().put(id, eObject); } }
private void handleDefinitionElement(Element element) { Definition definition = null; if (element == null) { definition = WSDLFactory.eINSTANCE.createDefinition(); ((DefinitionImpl)definition).setUseExtensionFactories(useExtensionFactories); } else { definition = DefinitionImpl.createDefinition(element, getURI().toString(), useExtensionFactories); } getContents().add(definition); // Do we need the next line? ((DefinitionImpl)definition).reconcileReferences(true); }
@Override protected void doUnload() { super.doUnload(); parseResult = null; }