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 a
URI representing given InternalEObject . |
org.eclipse.emf.common.util.URI |
getURI(org.eclipse.emf.ecore.EObject eObject,
boolean resolve)
Returns a
URI representing given InternalEObject . |
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 a
URI representing given eObject owned by owner through provided
feature .If the eObject is stand-alone (i.e freshly removed and without
attached resource) the URI is determine using the owner and the
feature , if the eObject is still attached to a Resource the
URI is calculated using same implementation as in ResourceImpl.unload() . |
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 a
URI representing given eObject owned by owner through provided
feature .If the eObject is stand-alone (i.e freshly removed and without
attached resource) the URI is determine using the owner and the
feature , if the eObject is still attached to a Resource the
URI is calculated using same implementation as in ResourceImpl.unload() . |
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) |
protected boolean |
isUseContextAwareProxyURIs() |
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
resource s 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()
ExtendedResource
getDefaultLoadOptions
in interface ExtendedResource
public java.util.Map<java.lang.Object,java.lang.Object> getDefaultSaveOptions()
ExtendedResource
getDefaultSaveOptions
in interface ExtendedResource
public java.util.Map<java.lang.Object,java.lang.Object> getProblemHandlingOptions()
ExtendedResource
resource
has been loaded or saved.getProblemHandlingOptions
in interface ExtendedResource
protected boolean isUseContextAwareProxyURIs()
public void unloaded(org.eclipse.emf.ecore.EObject eObject)
ExtendedResource
resource
s and proxy creation with custom URI
formats
during regular unload.unloaded
in interface ExtendedResource
ExtendedResource.OPTION_UNLOAD_MEMORY_OPTIMIZED
,
#getURI(InternalEObject)
public org.eclipse.emf.common.util.URI getURI(org.eclipse.emf.ecore.EObject eObject)
ExtendedResource
URI
representing given InternalEObject
. Clients may implement/override this method when
they require URIs with custom formats to be created.getURI
in interface ExtendedResource
InternalEObject
, or null
if no such could be created.public org.eclipse.emf.common.util.URI getURI(org.eclipse.emf.ecore.EObject eObject, boolean resolve)
ExtendedResource
URI
representing given InternalEObject
. Clients may implement/override this method when
they require URIs with custom formats to be created.getURI
in interface ExtendedResource
resolve
- indicates whether the URI should 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).InternalEObject
, or null
if no such could be created.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)
ExtendedResource
URI
representing given eObject
owned by owner
through provided
feature
.If the eObject
is stand-alone (i.e freshly removed and without
attached resource) the URI
is determine using the owner
and the
feature
, if the eObject
is still attached to a Resource
the
URI
is calculated using same implementation as in ResourceImpl.unload()
.
Clients may implement/override this method when they require URIs with custom formats to be created.
getURI
in interface ExtendedResource
oldOwner
- The EObject
owning the EObject
before it was deleted.oldFeature
- The EStructuralFeature
of the owner containing the eObject
before it was
deleted.eObject
- The EObject
for which the URI is to be created.eObject
, or null
if no such could be created.If the
provided EObject
has no eResource
and no owner
, the returned
value is null.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)
ExtendedResource
URI
representing given eObject
owned by owner
through provided
feature
.If the eObject
is stand-alone (i.e freshly removed and without
attached resource) the URI
is determine using the owner
and the
feature
, if the eObject
is still attached to a Resource
the
URI
is calculated using same implementation as in ResourceImpl.unload()
.
Clients may implement/override this method when they require URIs with custom formats to be created.
getURI
in interface ExtendedResource
oldOwner
- The EObject
owning the EObject
before it was deleted.oldFeature
- The EStructuralFeature
of the owner containing the eObject
before it was
deleted.eObject
- The EObject
for which the URI is to be created.resolve
- indicates whether the URI should 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).eObject
, or null
if no such could be created.If the
provided EObject
has no eResource
and no owner
, the returned
value is null.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)
ExtendedResource
URI
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 ExtendedResource
uriLiteral
- 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)
ExtendedResource
URI
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 ExtendedResource
eObject
- The object for which the HREF URI is to be created.public org.eclipse.emf.common.util.Diagnostic validateURI(java.lang.String uri)
ExtendedResource
validateURI
in interface ExtendedResource
uri
- 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)
ExtendedResource
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. 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 ExtendedResource
proxy
- The proxy to be handled.ExtendedResource.trimProxyContextInfo(URI)
public org.eclipse.emf.common.util.URI trimProxyContextInfo(org.eclipse.emf.common.util.URI proxyURI)
ExtendedResource
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.trimProxyContextInfo
in interface ExtendedResource
proxyURI
- 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.Adapter
isAdapterForType
in class org.eclipse.emf.common.notify.impl.AdapterImpl
public void setTarget(org.eclipse.emf.common.notify.Notifier newTarget)
setTarget
in interface org.eclipse.emf.common.notify.Adapter
setTarget
in class org.eclipse.emf.common.notify.impl.AdapterImpl