public class MetaModelDescriptorRegistry
extends java.lang.Object
implements org.eclipse.core.runtime.IAdaptable
Modifier and Type | Field and Description |
---|---|
static IMetaModelDescriptor |
ANY_MM
A default meta-model descriptor for any type of meta model.
|
static MetaModelDescriptorRegistry |
INSTANCE
The singleton instance of this registry.
|
static IMetaModelDescriptor |
NO_MM
A default meta-model descriptor for no meta model.
|
Modifier and Type | Method and Description |
---|---|
void |
addDescriptor(IMetaModelDescriptor mmDescriptor)
Add the specified
mmDescriptor to this registry (if not already added). |
protected IMetaModelDescriptor |
createDescriptor(org.eclipse.emf.ecore.EPackage ePackage) |
java.lang.Object |
getAdapter(java.lang.Class adapterType) |
IMetaModelDescriptor |
getDescriptor(java.lang.Class<?> clazz)
Deprecated.
It is not recommended use this method because the
metamodel descriptor
retrieval strategy implemented here has the side effect of that it triggers a full initialization of
all EPackage s behind potentially all metamodel descriptor s. This
can have significant impact on runtime performance and may cause that the EPackage s of
metamodels become initialized even though not a single instance of these metamodels exists in the
workspace. |
IMetaModelDescriptor |
getDescriptor(org.eclipse.emf.ecore.EClass eClass) |
IMetaModelDescriptor |
getDescriptor(org.eclipse.emf.ecore.EClassifier eClassifier) |
IMetaModelDescriptor |
getDescriptor(org.eclipse.emf.ecore.EObject eObject) |
IMetaModelDescriptor |
getDescriptor(org.eclipse.emf.ecore.EPackage ePackage) |
IMetaModelDescriptor |
getDescriptor(org.eclipse.emf.ecore.util.FeatureMap.Entry entry) |
IMetaModelDescriptor |
getDescriptor(org.eclipse.core.resources.IFile file)
Returns the
meta-model descriptor for given file . |
IMetaModelDescriptor |
getDescriptor(org.eclipse.emf.edit.provider.IWrapperItemProvider wrapperItemProvider) |
IMetaModelDescriptor |
getDescriptor(java.lang.Object object) |
IMetaModelDescriptor |
getDescriptor(org.eclipse.emf.ecore.resource.Resource resource)
Returns the
meta-model descriptor for the given resource . |
IMetaModelDescriptor |
getDescriptor(java.lang.String identifier) |
<T extends IMetaModelDescriptor> |
getDescriptor(T mmDescriptor,
int ordinal)
Deprecated.
|
IMetaModelDescriptor |
getDescriptor(TransientItemProvider transientItemProvider) |
<T extends IMetaModelDescriptor> |
getDescriptor(T mmDescriptor,
java.lang.String name) |
IMetaModelDescriptor |
getDescriptor(java.net.URI namespaceURI) |
java.util.List<IMetaModelDescriptor> |
getDescriptors(java.lang.String idPattern) |
<T extends IMetaModelDescriptor> |
getDescriptors(T mmDescriptor) |
<T extends IMetaModelDescriptor> |
getDescriptors(T mmDescriptor,
boolean sorted)
Used in UI component to return a list of sorted descriptors.
|
java.util.List<IMetaModelDescriptor> |
getDescriptorsFromURIScheme(java.lang.String scheme)
Returns the
descriptors of all meta-models that use URIs with given
customURIScheme in cross-document references and as proxy URIs. |
IMetaModelDescriptor |
getEffectiveDescriptor(org.eclipse.core.resources.IFile file)
Retrieves
meta-model descriptor behind the given file which will be
eventually effective or relevant to clients. |
IMetaModelDescriptor |
getEffectiveDescriptor(org.eclipse.emf.ecore.resource.Resource resource)
Retrieves
meta-model descriptor behind the given resource which
will be eventually effective or relevant to clients. |
java.util.Collection<java.lang.String> |
getFileExtensionsAssociatedWithTargetDescriptors()
Deprecated.
|
IMetaModelDescriptor |
getOldDescriptor(org.eclipse.core.resources.IFile file)
Returns the old
meta-model descriptor which given file had had before
is was changed or deleted. |
IMetaModelDescriptor |
getOldDescriptor(org.eclipse.emf.ecore.resource.Resource resource)
Returns the old
meta-model descriptor which given resource had had
before is was changed or deleted. |
java.util.List<IMetaModelDescriptor> |
getResolvedDescriptors(IMetaModelDescriptor mmDescriptor) |
IMetaModelDescriptor |
getResourceVersionDescriptor(org.eclipse.emf.ecore.resource.Resource resource)
Returns a
descriptor describing the version of specified resource . |
IMetaModelDescriptor |
getTargetDescriptor(org.eclipse.core.resources.IFile file)
Retrieves
target meta-model descriptor behind the given file . |
IMetaModelDescriptor |
getTargetDescriptor(org.eclipse.emf.ecore.resource.Resource resource)
Retrieves
target meta-model descriptor behind the given resource . |
boolean |
isContentTypeOfTargetDescriptorsApplicable(org.eclipse.core.resources.IFile file)
Returns true if the extension of the passed in file matches any extension of all file types which are associated
with a
target meta-model descriptor . |
void |
setExtensionRegistry(org.eclipse.core.runtime.IExtensionRegistry extensionRegistry) |
public static final MetaModelDescriptorRegistry INSTANCE
public static final IMetaModelDescriptor ANY_MM
public static final IMetaModelDescriptor NO_MM
public void setExtensionRegistry(org.eclipse.core.runtime.IExtensionRegistry extensionRegistry)
protected IMetaModelDescriptor createDescriptor(org.eclipse.emf.ecore.EPackage ePackage)
public void addDescriptor(IMetaModelDescriptor mmDescriptor)
mmDescriptor
to this registry (if not already added).mmDescriptor
- The meta-model descriptor to add to this registry.public java.lang.Object getAdapter(java.lang.Class adapterType)
getAdapter
in interface org.eclipse.core.runtime.IAdaptable
public java.util.List<IMetaModelDescriptor> getResolvedDescriptors(IMetaModelDescriptor mmDescriptor)
mmDescriptor
- public IMetaModelDescriptor getDescriptor(java.lang.Object object)
public <T extends IMetaModelDescriptor> java.util.List<T> getDescriptors(T mmDescriptor, boolean sorted)
mmDescriptor
- public <T extends IMetaModelDescriptor> java.util.List<T> getDescriptors(T mmDescriptor)
mmDescriptor
- public IMetaModelDescriptor getDescriptor(java.lang.String identifier)
identifier
- A meta-model descriptor identifier.public java.util.List<IMetaModelDescriptor> getDescriptors(java.lang.String idPattern)
idPattern
- A regular expression which the identifiers of the returned meta-model descriptors must match.public java.util.List<IMetaModelDescriptor> getDescriptorsFromURIScheme(java.lang.String scheme)
descriptors
of all meta-models that use URIs with given
customURIScheme
in cross-document references and as proxy URIs.scheme
- The custom URI scheme for which the descriptors of the meta-model using it is to be returned.customURIScheme
.@Deprecated public <T extends IMetaModelDescriptor> T getDescriptor(T mmDescriptor, int ordinal)
MetaModelVersionData.getOrdinal()
mmDescriptor
- ordinal
- public <T extends IMetaModelDescriptor> T getDescriptor(T mmDescriptor, java.lang.String name)
mmDescriptor
- name
- public IMetaModelDescriptor getDescriptor(org.eclipse.emf.ecore.resource.Resource resource)
meta-model descriptor
for the given resource
.resource
- The resource
whose meta-model descriptor is to be returned.resource
.public IMetaModelDescriptor getDescriptor(org.eclipse.core.resources.IFile file)
meta-model descriptor
for given file
.file
- The file
whose meta-model descriptor
is to be returned.meta-model descriptor
of given IFile
, or null
if no
such could be determined.public IMetaModelDescriptor getOldDescriptor(org.eclipse.emf.ecore.resource.Resource resource)
meta-model descriptor
which given resource
had had
before is was changed or deleted. !Important note! The information will only be available during processing of
the method
org.eclipse.sphinx.emf.metamodel.MetaModelDescriptorRegistry.FileMetaModelDescriptorCache.removeDescriptor(IFile)
called from org.eclipse.sphinx.emf.internal.MetaModelDescriptorCacheAndModelDescriptorRegistryUpdater.
handleModelResourceUnloaded(Collectionresource
- The resource
whose old meta-model descriptor
is to be
returned.meta-model descriptor
of given Resource
, or
null
file
hadn't had any meta-model descriptor
before it was changed or deleted.public IMetaModelDescriptor getOldDescriptor(org.eclipse.core.resources.IFile file)
meta-model descriptor
which given file
had had before
is was changed or deleted. !Important note! The information will only be available during processing of the
method
org.eclipse.sphinx.emf.metamodel.MetaModelDescriptorRegistry.FileMetaModelDescriptorCache.removeDescriptor(IFile)
called from org.eclipse.sphinx.emf.internal.MetaModelDescriptorCacheAndModelDescriptorRegistryUpdater.
handleModelResourceUnloaded(Collectionfile
- The file
whose old meta-model descriptor
is to be returned.meta-model descriptor
of given IFile
, or null
file
hadn't had any meta-model descriptor
before it was
changed or deleted.public IMetaModelDescriptor getDescriptor(org.eclipse.emf.ecore.EObject eObject)
eObject
- public IMetaModelDescriptor getDescriptor(org.eclipse.emf.ecore.EClass eClass)
eClass
- public IMetaModelDescriptor getDescriptor(org.eclipse.emf.ecore.EClassifier eClassifier)
eClass
- public IMetaModelDescriptor getDescriptor(org.eclipse.emf.ecore.EPackage ePackage)
ePackage
- public IMetaModelDescriptor getDescriptor(org.eclipse.emf.edit.provider.IWrapperItemProvider wrapperItemProvider)
wrapperItemProvider
- public IMetaModelDescriptor getDescriptor(org.eclipse.emf.ecore.util.FeatureMap.Entry entry)
entry
- public IMetaModelDescriptor getDescriptor(TransientItemProvider transientItemProvider)
transientItemProvider
- public IMetaModelDescriptor getDescriptor(java.net.URI namespaceURI)
namespaceURI
- @Deprecated public IMetaModelDescriptor getDescriptor(java.lang.Class<?> clazz)
metamodel descriptor
retrieval strategy implemented here has the side effect of that it triggers a full initialization of
all EPackage
s behind potentially all metamodel descriptor
s. This
can have significant impact on runtime performance and may cause that the EPackage
s of
metamodels become initialized even though not a single instance of these metamodels exists in the
workspace.class
- public IMetaModelDescriptor getTargetDescriptor(org.eclipse.core.resources.IFile file)
target meta-model descriptor
behind the given file
.file
- The file
to be investigated.file
's target meta-model descriptor
or null
if no such exists.public IMetaModelDescriptor getTargetDescriptor(org.eclipse.emf.ecore.resource.Resource resource)
target meta-model descriptor
behind the given resource
.resource
- The resource
to be investigated.resource
's target meta-model descriptor
or
null
if no such exists.@Deprecated public java.util.Collection<java.lang.String> getFileExtensionsAssociatedWithTargetDescriptors()
isContentTypeOfTargetDescriptorsApplicable(IFile)
insteadtarget
meta-model descriptor
. Includes both file extensions for which a target meta-model
descriptor
has been specified directly and file extensions supported by content types for which a
target meta-model descriptor
has been defined.collection
with all file types associated with a target
meta-model descriptor
or an empty collection
if no such exist.public boolean isContentTypeOfTargetDescriptorsApplicable(org.eclipse.core.resources.IFile file)
target meta-model descriptor
. Matching is done against both file extensions
for which a target meta-model descriptor
has been specified directly and file
extensions supported by content types for which a target meta-model descriptor
has
been defined.public IMetaModelDescriptor getEffectiveDescriptor(org.eclipse.core.resources.IFile file)
meta-model descriptor
behind the given file
which will be
eventually effective or relevant to clients. This is the IFile
's target
meta-model descriptor
if such one is available or the IFile
's native meta-model descriptor
otherwise.file
- The file
to be investigated.file
's effective meta-model descriptor
or
null
if no such exists.public IMetaModelDescriptor getEffectiveDescriptor(org.eclipse.emf.ecore.resource.Resource resource)
meta-model descriptor
behind the given resource
which
will be eventually effective or relevant to clients. This is the IFile
's target meta-model descriptor
if such one is available or the IFile
's native meta-model descriptor
otherwise.resource
- The resource
to be investigated.resource
's effective meta-model descriptor
or
null
if no such exists.public IMetaModelDescriptor getResourceVersionDescriptor(org.eclipse.emf.ecore.resource.Resource resource)
descriptor
describing the version of specified resource
.
This is done by retrieving the resource's model namespace
and finding a matching metamodel descriptor
or
compatible resource version descriptor
.resource
- The resource
whose version descriptor is to be retrieved.version descriptor
or null
if no such could be
determined.EcoreResourceUtil.readModelNamespace(Resource)
,
#getCompatibleResourceVersionDescriptors()