public class ExtendedResourceAdapter extends org.eclipse.emf.common.notify.impl.AdapterImpl implements ExtendedResource
Adapter-based implementation of ExtendedResource.| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.Object,java.lang.Object> |
problemHandlingOptions
The map of options that are used to to control the handling of problems encountered while the
resource has been loaded or saved. |
COLUMN_NUMBER_KEY_NAME, LINE_NUMBER_KEY_NAME, OPTION_ENABLE_SCHEMA_VALIDATION, OPTION_MAX_PROBLEM_MARKER_COUNT, OPTION_MAX_PROBLEM_MARKER_COUNT_DEFAULT, OPTION_MAX_PROBLEM_MARKER_COUNT_UNLIMITED, OPTION_PROBLEM_MARKER_FACTORY, OPTION_PROGRESS_MONITOR, OPTION_RECORD_LINE_AND_COLUMN_NUMBERS, OPTION_RESOURCE_VERSION_DESCRIPTOR, OPTION_SCHEMA_LOCATION_CATALOG, OPTION_TARGET_METAMODEL_DESCRIPTOR_ID, OPTION_UNLOAD_MEMORY_OPTIMIZED, OPTION_USE_CONTEXT_AWARE_PROXY_URIS, OPTION_XML_VALIDITY_PROBLEM_FORMAT_STRING, OPTION_XML_VALIDITY_PROBLEM_FORMAT_STRING_DEFAULT, OPTION_XML_VALIDITY_PROBLEM_SEVERITY, OPTION_XML_WELLFORMEDNESS_PROBLEM_FORMAT_STRING, OPTION_XML_WELLFORMEDNESS_PROBLEM_FORMAT_STRING_DEFAULT, URI_FRAGMENT_SEPARATOR, URI_QUERY_FIELD_PATTERN, URI_QUERY_FIELD_PATTERN_KEY_GROUP_IDX, URI_QUERY_FIELD_PATTERN_VALUE_GROUP_IDX, URI_QUERY_FIELD_SEPARATOR, URI_QUERY_KEY_VALUE_SEPARATOR, URI_QUERY_SEPARATOR, URI_SCHEME_SEPARATOR, URI_SEGMENT_SEPARATOR| Constructor and Description |
|---|
ExtendedResourceAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
augmentToContextAwareProxy(org.eclipse.emf.ecore.EObject proxy)
Augments given
proxy to a context-aware proxy by adding key/value pairs that contain the
target metamodel descriptor and a context URI to the query string of the proxy URI. |
org.eclipse.emf.common.util.URI |
createURI(java.lang.String uriLiteral,
org.eclipse.emf.ecore.EClass eClass)
Creates a
URI from given uriLiteral that refers to an instance of given object
type. |
java.util.Map<java.lang.Object,java.lang.Object> |
getDefaultLoadOptions()
Returns the map of options that, in addition to the overriding options specified during load, are used to to
control load behavior.
|
java.util.Map<java.lang.Object,java.lang.Object> |
getDefaultSaveOptions()
Returns the map of options that, in addition to the overriding options specified during save, are used to to
control save behavior.
|
org.eclipse.emf.common.util.URI |
getHREF(org.eclipse.emf.ecore.EObject eObject)
Returns a
URI representing an HREF to given EObject stored in underlying Resource. |
protected org.eclipse.emf.common.util.URI |
getOldURI(org.eclipse.emf.ecore.EObject oldOwner,
org.eclipse.emf.ecore.EStructuralFeature oldFeature,
org.eclipse.emf.ecore.EObject eObject,
boolean resolve) |
java.util.Map<java.lang.Object,java.lang.Object> |
getProblemHandlingOptions()
Returns the map of options that are used to control the handling of problems encountered while the
resource has been loaded or saved. |
org.eclipse.emf.common.util.URI |
getURI(org.eclipse.emf.ecore.EObject eObject)
Returns the
URI representing given object. |
org.eclipse.emf.common.util.URI |
getURI(org.eclipse.emf.ecore.EObject eObject,
boolean resolve)
Returns the
URI representing given object. |
org.eclipse.emf.common.util.URI |
getURI(org.eclipse.emf.ecore.EObject oldOwner,
org.eclipse.emf.ecore.EStructuralFeature oldFeature,
org.eclipse.emf.ecore.EObject eObject)
Returns the
URI representing given object. |
org.eclipse.emf.common.util.URI |
getURI(org.eclipse.emf.ecore.EObject oldOwner,
org.eclipse.emf.ecore.EStructuralFeature oldFeature,
org.eclipse.emf.ecore.EObject eObject,
boolean resolve)
Returns the
URI representing given object. |
protected org.eclipse.emf.common.util.URI |
getURI(org.eclipse.emf.common.util.URI resourceURI,
java.lang.String eObjectURIFragment) |
protected org.eclipse.emf.common.util.URI |
getURI(org.eclipse.emf.common.util.URI resourceURI,
java.lang.String eObjectURIFragment,
boolean resolve) |
boolean |
isAdapterForType(java.lang.Object type) |
boolean |
isFullyLoaded()
Indicates if the underlying
resource has been fully loaded. |
protected boolean |
isUseContextAwareProxyURIs() |
java.lang.String |
nomalizeURIFragment(java.lang.String uriFragment)
Returns the normalized form of the given
URI fragment. |
protected org.eclipse.emf.common.util.URI |
resolveURI(org.eclipse.emf.common.util.URI uri) |
void |
setTarget(org.eclipse.emf.common.notify.Notifier newTarget) |
org.eclipse.emf.common.util.URI |
trimProxyContextInfo(org.eclipse.emf.common.util.URI proxyURI)
If given
proxy URI contains proxy context-related key/value pairs on its query
string, returns the URI formed by removing those key/value pairs or removing the query string entirely in case
that no other key/value pairs exist; returns given proxy URI unchanged, otherwise. |
void |
unloaded(org.eclipse.emf.ecore.EObject eObject)
Improved implementation of org.eclipse.emf.ecore.resource.impl.ResourceImpl#unloaded(InternalEObject) enabling
memory-optimized unloading of
resources and proxy creation with custom URI formats
during regular unload. |
org.eclipse.emf.common.util.Diagnostic |
validateURI(java.lang.String uri)
Determines whether or not the given URI string represents a valid URI.
|
protected java.util.Map<java.lang.Object,java.lang.Object> problemHandlingOptions
resource has been loaded or saved.public java.util.Map<java.lang.Object,java.lang.Object> getDefaultLoadOptions()
ExtendedResourcegetDefaultLoadOptions in interface ExtendedResourcepublic java.util.Map<java.lang.Object,java.lang.Object> getDefaultSaveOptions()
ExtendedResourcegetDefaultSaveOptions in interface ExtendedResourcepublic java.util.Map<java.lang.Object,java.lang.Object> getProblemHandlingOptions()
ExtendedResourceresource has been loaded or saved.getProblemHandlingOptions in interface ExtendedResourceprotected boolean isUseContextAwareProxyURIs()
public boolean isFullyLoaded()
ExtendedResourceresource has been fully loaded. By default, this is the case when
Resource.isLoaded() returns true.
Custom ExtendedResource implementations may override this method and adapt its behavior to take
additional aspects into account, e.g., the completion state of asynchronously performed post load operations or
communication processes running in the background.
isFullyLoaded in interface ExtendedResourcetrue if the underlying resource has been fully loaded, false otherwise.public void unloaded(org.eclipse.emf.ecore.EObject eObject)
ExtendedResourceresources and proxy creation with custom URI formats
during regular unload.unloaded in interface ExtendedResourceExtendedResource.OPTION_UNLOAD_MEMORY_OPTIMIZED,
#getURI(InternalEObject)public org.eclipse.emf.common.util.URI getURI(org.eclipse.emf.ecore.EObject eObject)
ExtendedResourceURI representing given object.getURI in interface ExtendedResourceeObject - The object to be handled.public org.eclipse.emf.common.util.URI getURI(org.eclipse.emf.ecore.EObject eObject,
boolean resolve)
ExtendedResourceURI representing given object. The resulting URI can optionally be resolved
against the URI of the resource which contains the object in question.getURI in interface ExtendedResourceeObject - The object to be handled.resolve - Indicates whether the object's URI should be resolved against the URI of the resource which contains
the provided model object. This is useful is cases where the native model object URI evaluates in some
sort of fragment-based URI which does not contain any information about the resource that contains the
model object (e.g., hb:/#//MyComponent/MyParameterValue). By setting resolve to true, such
fragment-based URIs will be automatically expanded to a URI that starts with the URI of the model
object's resource and is followed by the fragment of the model object's native URI (e.g.,
platform:/resource/MyProject/MyResource/#//MyComponent/MyParameterValue).public org.eclipse.emf.common.util.URI getURI(org.eclipse.emf.ecore.EObject oldOwner,
org.eclipse.emf.ecore.EStructuralFeature oldFeature,
org.eclipse.emf.ecore.EObject eObject)
ExtendedResourceURI representing given object. If the object is removed (i.e., not contained
in any resource) its URI is determined by appending the URI fragment segments obtained from the
removed object and its potential direct and indirect removed containers to the base URI obtained from the
provided old owner and old feature. If the object is still contained
in a resource its URI is computed as usual and the old owner and old feature are ignored.getURI in interface ExtendedResourceoldOwner - The owner object that is assumed to having contained the given object before it was removed.oldFeature - The feature through which the old owner did contain the given object before it was removed.eObject - The object to be handled.public org.eclipse.emf.common.util.URI getURI(org.eclipse.emf.ecore.EObject oldOwner,
org.eclipse.emf.ecore.EStructuralFeature oldFeature,
org.eclipse.emf.ecore.EObject eObject,
boolean resolve)
ExtendedResourceURI representing given object. If the object is removed (i.e., not contained
in any resource) its URI is determined by appending the URI fragment segments obtained from the
removed object and its potential direct and indirect removed containers to the base URI obtained from the
provided old owner and old feature. If the object is still contained
in a resource its URI is computed as usual and the old owner and old feature are ignored. In both cases, the
resulting URI can optionally be resolved against the URI of the resource which does or did contain the object in
question.getURI in interface ExtendedResourceoldOwner - The owner object that is assumed to having contained the given object before it was removed.oldFeature - The feature through which the old owner did contain the given object before it was removed.eObject - The object to be handled.resolve - Indicates whether the object's URI should be resolved against the URI of the resource which contains
the provided model object. This is useful is cases where the native model object URI evaluates in some
sort of fragment-based URI which does not contain any information about the resource that contains the
model object (e.g., hb:/#//MyComponent/MyParameterValue). By setting resolve to true, such
fragment-based URIs will be automatically expanded to a URI that starts with the URI of the model
object's resource and is followed by the fragment of the model object's native URI (e.g.,
platform:/resource/MyProject/MyResource/#//MyComponent/MyParameterValue).protected org.eclipse.emf.common.util.URI getURI(org.eclipse.emf.common.util.URI resourceURI,
java.lang.String eObjectURIFragment,
boolean resolve)
protected org.eclipse.emf.common.util.URI getURI(org.eclipse.emf.common.util.URI resourceURI,
java.lang.String eObjectURIFragment)
protected org.eclipse.emf.common.util.URI getOldURI(org.eclipse.emf.ecore.EObject oldOwner,
org.eclipse.emf.ecore.EStructuralFeature oldFeature,
org.eclipse.emf.ecore.EObject eObject,
boolean resolve)
protected org.eclipse.emf.common.util.URI resolveURI(org.eclipse.emf.common.util.URI uri)
public org.eclipse.emf.common.util.URI createURI(java.lang.String uriLiteral,
org.eclipse.emf.ecore.EClass eClass)
ExtendedResourceURI from given uriLiteral that refers to an instance of given object
type. This method is typically called during deserialization of resources when it comes to creating proxy URIs
from serialized representations of cross-document references to objects in other resources.
Clients may implement/override this method when they require URIs with custom formats to be created
createURI in interface ExtendedResourceuriLiteral - The string representation of the URI to be created.eClass - The type of object that the URI to be created is supposed to refer to.uriLiteral.public org.eclipse.emf.common.util.URI getHREF(org.eclipse.emf.ecore.EObject eObject)
ExtendedResourceURI representing an HREF to given EObject stored in underlying Resource. This
method is typically called during serialization of resources when it comes to creating serializable
representations of cross-document references for objects being referenced from other resources.
Clients may implement/override this method when they require HREFs with custom formats to be created.
getHREF in interface ExtendedResourceeObject - The object for which the HREF URI is to be created.public java.lang.String nomalizeURIFragment(java.lang.String uriFragment)
ExtendedResourceURI fragment.
This may, in theory, do absolutely anything. The general idea behind this feature is to support resources in which the URI fragments used to identify objects can have manifold forms. The URI fragments that refer to a given object can then no longer be assumed to be always the same. Instead they may have alternative forms and look differently from case to case (e.g., have an additional postfix in simple cases, or a completely different format in more advanced cases). The URI fragment normalization enables such manifold URI fragments to be converted into a common base form and make them comparable. There is no general assumption of what normalized URI fragments should look like except for that they always must evaluate to the same string when the original URI fragments refer to the same object.
It is important to emphasize that normalization can result in loss of information. The normalized URI fragment should generally be used only for the comparison of the identities of the objects being referred to.
nomalizeURIFragment in interface ExtendedResourceuriFragment - The URI fragment to normalize.public org.eclipse.emf.common.util.Diagnostic validateURI(java.lang.String uri)
ExtendedResourcevalidateURI in interface ExtendedResourceuri - The URI string to be validated.Diagnostic.OK_INSTANCE if given URI string is a valid URI or a Diagnostic with
complementary information on error otherwise.public void augmentToContextAwareProxy(org.eclipse.emf.ecore.EObject proxy)
ExtendedResourceproxy to a context-aware proxy by adding key/value pairs that contain the
target metamodel descriptor and a context URI to the query string of the proxy URI. Those are required to support the resolution of proxified references between
objects from different metamodels and to honor the resource scope of the proxy URI when it
is being resolved.augmentToContextAwareProxy in interface ExtendedResourceproxy - The proxy to be handled.ExtendedResource.trimProxyContextInfo(URI)public org.eclipse.emf.common.util.URI trimProxyContextInfo(org.eclipse.emf.common.util.URI proxyURI)
ExtendedResourceproxy URI contains proxy context-related key/value pairs on its query
string, returns the URI formed by removing those key/value pairs or removing the query string entirely in case
that no other key/value pairs exist; returns given proxy URI unchanged, otherwise.trimProxyContextInfo in interface ExtendedResourceproxyURI - The context-aware proxy URI to be handled.ExtendedResource.augmentToContextAwareProxy(EObject)public boolean isAdapterForType(java.lang.Object type)
isAdapterForType in interface org.eclipse.emf.common.notify.AdapterisAdapterForType in class org.eclipse.emf.common.notify.impl.AdapterImplpublic void setTarget(org.eclipse.emf.common.notify.Notifier newTarget)
setTarget in interface org.eclipse.emf.common.notify.AdaptersetTarget in class org.eclipse.emf.common.notify.impl.AdapterImpl