public interface IRMPResource
extends org.eclipse.emf.ecore.resource.Resource
An IRMPResource represents a resource that is capable of determining whether
it has been loaded from an artifact that was produced by an older runtime. It supports
saving back to that specific older format (but not arbitrary older formats) until it
has been saved as the current version. Once this type of XMIResource
has
been saved in the new format then the ability to save back into the older format
is forfeited.
Also, this resource can produce warnings available in the Resource.getWarnings()
of type UnknownSignatureDiagnostic
that indicate that the artifact contained
some signature that was unknown to this runtime. The diagnostic object provides a
list of features that should be installed in order to load the resource properly.
Whenever loading/saving IRMPResources it is important to check the errors and warnings lists
(Resource.getWarnings()
, Resource.getErrors()
for Resource.Diagnostic
objects that might indicate that there were missing
packages or missing classes. These could indicate that the resource loaded but there
was a missing EPackage or that the package registry has registered a newer/older
version of the metamodel against a newer/older nsURI.
After saving with the OPTION_PRESERVE_CONTENT_VERSION
option to preserve
backward compatibility, it is important
to check the Resource.getWarnings()
and Resource.getErrors()
collections
to see if one of the resource handlers had a problem saving. If there was an error in this
case then the user should probably be notified. After examining the errors, the client is
responsible for clearing the errors. The user should probably be asked to save the resource
in the newest format in this case because a loss of data has occurred.
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 java.lang.String |
OPTION_PRESERVE_CONTENT_VERSION
This option is put into the save options map with a value of
Boolean.TRUE to indicate that the resource should be
saved into the same format as it was loaded. |
static java.lang.String |
OPTION_SAVE_CLEARCASE_TOKEN
This option is put into the save options map with a value of
Boolean.FALSE to prevent serialization of the EMF compare-merge engine's
ClearCase type manager token. |
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 |
---|---|
java.util.Map<java.lang.Object,java.lang.Object> |
getResourceHandlerStore(java.lang.Class<?> resourceHandlerClass)
Retrieves the special store used by a specific type of resource handler to
store its iterim data.
|
boolean |
isOlderArtifactVersion()
Determines if this resource has been loaded from an artifact that was
produced by an older version of the runtime.
|
delete, getAllContents, getContents, getEObject, getErrors, getResourceSet, getTimeStamp, getURI, getURIFragment, getWarnings, isLoaded, isModified, isTrackingModification, load, load, save, save, setModified, setTimeStamp, setTrackingModification, setURI, unload
static final java.lang.String OPTION_PRESERVE_CONTENT_VERSION
Boolean.TRUE
to indicate that the resource should be
saved into the same format as it was loaded. This option is most often
used if
the resource reports true for isOlderArtifactVersion()
, which could happen
if the resource was loaded and found to be an older version and if the
resource was never saved into the newest version.static final java.lang.String OPTION_SAVE_CLEARCASE_TOKEN
Boolean.FALSE
to prevent serialization of the EMF compare-merge engine's
ClearCase type manager token. Otherwise, the token may be serialized at the top of the
file. The token should not be used if the resource
has not been properly integrated into the EMF compare-merge engine.boolean isOlderArtifactVersion()
java.util.Map<java.lang.Object,java.lang.Object> getResourceHandlerStore(java.lang.Class<?> resourceHandlerClass)
XMLResource.ResourceHandler
objects that are being called by the framework.resourceHandlerClass
- The class object of the resource handler for which
the store is owned.