@ParametersAreNonnullByDefault public interface PersistentResource extends org.eclipse.emf.ecore.resource.Resource, org.eclipse.emf.ecore.resource.Resource.Internal, Storable, Closeable, Iterable<PersistentEObject>
Resource
that provides efficient model-level operations that are not accessible using the standard EMF
API.
For example, allInstancesOf(EClass)
is a utility method that computes efficiently all the instances of a
given type by delegating the operation to the underlying database, that can benefits of its internal optimizations
and indices.
org.eclipse.emf.ecore.resource.Resource.Diagnostic, org.eclipse.emf.ecore.resource.Resource.Factory, org.eclipse.emf.ecore.resource.Resource.Internal, org.eclipse.emf.ecore.resource.Resource.IOWrappedException
Modifier and Type | Field and Description |
---|---|
static Id |
ROOT_ID
The identifier of the root element in a
PersistentResource . |
static int |
ROOT_REFERENCE_ID
The name of the property used by the
ROOT_ID element to define its content. |
static String |
ROOT_REFERENCE_NAME
The name of the property used by the
ROOT_ID element to define its content. |
OPTION_CIPHER, OPTION_LINE_DELIMITER, OPTION_LINE_DELIMITER_UNSPECIFIED, OPTION_SAVE_ONLY_IF_CHANGED, OPTION_SAVE_ONLY_IF_CHANGED_FILE_BUFFER, OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER, OPTION_ZIP, RESOURCE__CONTENTS, RESOURCE__ERRORS, RESOURCE__IS_LOADED, RESOURCE__IS_MODIFIED, RESOURCE__IS_TRACKING_MODIFICATION, RESOURCE__RESOURCE_SET, RESOURCE__TIME_STAMP, RESOURCE__URI, RESOURCE__WARNINGS
Modifier and Type | Method and Description |
---|---|
default <T extends org.eclipse.emf.ecore.EObject> |
allInstancesOf(org.eclipse.emf.ecore.EClass eClass)
Computes the set of instances of the given
EClass (including its sub-types). |
<T extends org.eclipse.emf.ecore.EObject> |
allInstancesOf(org.eclipse.emf.ecore.EClass eClass,
boolean strict)
Computes the set of instances of the given
EClass . |
void |
close() |
static boolean |
isPersistent(org.eclipse.emf.ecore.resource.Resource resource)
Checks that the
resource is persistent. |
default Iterator<PersistentEObject> |
iterator()
Returns an iterator on the direct content of this resource.
|
void |
load(ImmutableConfig config)
Loads the resource using the specified configuration.
|
void |
save(ImmutableConfig config)
Saves the resource using the specified configuration.
|
attached, basicSetResourceSet, detached, isLoading
delete, getAllContents, getContents, getEObject, getErrors, getResourceSet, getTimeStamp, getURI, getURIFragment, getWarnings, isLoaded, isModified, isTrackingModification, load, load, save, save, setModified, setTimeStamp, setTrackingModification, setURI, unload
eAdapters, eDeliver, eNotify, eSetDeliver
forEach, spliterator
@Nonnull static final Id ROOT_ID
PersistentResource
.@Nonnegative static final int ROOT_REFERENCE_ID
ROOT_ID
element to define its content.@Nonnull static final String ROOT_REFERENCE_NAME
ROOT_ID
element to define its content.static boolean isPersistent(@Nullable org.eclipse.emf.ecore.resource.Resource resource)
resource
is persistent.resource
- the resource to testtrue
if the resource is persistentvoid close()
close
in interface AutoCloseable
close
in interface Closeable
void save(ImmutableConfig config) throws IOException
config
- the save configurationIOException
- if an I/O error occurs during savingResource.save(java.util.Map)
void load(ImmutableConfig config) throws IOException
config
- the load configurationIOException
- if an I/O error occurs during loadingResource.load(java.util.Map)
@Nonnull default <T extends org.eclipse.emf.ecore.EObject> Iterable<T> allInstancesOf(org.eclipse.emf.ecore.EClass eClass)
EClass
(including its sub-types).
This method behaves like: allInstancesOf(EClass, false)
.
eClass
- the EClass
for which look for instancesEClass
from the resourceallInstancesOf(EClass, boolean)
@Nonnull <T extends org.eclipse.emf.ecore.EObject> Iterable<T> allInstancesOf(org.eclipse.emf.ecore.EClass eClass, boolean strict)
EClass
.eClass
- the EClass
for which look for instancesstrict
- true
if the lookup searches for strict instancestrue
then the method returns only the strict instances of the given EClass
, otherwise
it also returns the instances of the sub-types of eClass
.@Nonnull default Iterator<PersistentEObject> iterator()
iterator
in interface Iterable<PersistentEObject>
Resource.getContents()
Copyright © 2013–2019 Atlanmod. All rights reserved.