A resource of an appropriate type is {@link Factory#createResource created} by a resource factory;a resource set indirectly {@link ResourceSet#createResource(URI) creates} a resource using such a factory.A resource is typically {@link #getResourceSet contained} by a resource set,along with related resources. It has a {@link #getURI URI} representing it's identityand that URI is {@link org.eclipse.emf.ecore.resource.URIConverter used}to determine where to {@link #save(Map) save} and {@link #load(Map) load}. It provides modeled {@link #getContents contents}, in fact, it provides even the {@link #getAllContents tree} of modeled contents,as well as {@link Diagnostic diagnostics} for {@link #getErrors errors} and {@link #getWarnings other} problems.It may be {@link #unload unloaded} to discard the contents and the load state can be {@link #isLoaded queried}. {@link #isModified Modification} can be {@link #isTrackingModification tracked}, but it's expensive. The resource will be informed as objects are {@link Resource.Internal#attached attached} and {@link Resource.Internal#detached detached}; if needed, it will be able to maintain a map to support {@link #getEObject getEObject}. Structured URI {@link #getURIFragment fragments} are used rather than IDs, since they are a more general alternative.Clients must extend the default {@link org.eclipse.emf.ecore.resource.impl.ResourceImpl implementation}, or one of its derived classes, since methods can and will be added to this API.
A resource produces notification for changes to the value of each of these features:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|