public abstract class AbstractMetaModelDescriptor extends org.eclipse.core.runtime.PlatformObject implements IMetaModelDescriptor
IMetaModelDescriptor interface.
Extends PlatformObject in order to be adaptable by Eclipse adapters mechanism.
IMetaModelDescriptor| Modifier and Type | Field and Description |
|---|---|
protected java.net.URI |
fBaseNamespaceURI |
protected static java.lang.String |
URI_SEGMENT_SEPARATOR |
LABEL_PATTERN| Modifier | Constructor and Description |
|---|---|
protected |
AbstractMetaModelDescriptor(java.lang.String identifier,
java.lang.String baseNamespace,
MetaModelVersionData versionData)
Creates a descriptor for a concrete version of a meta-model.
|
protected |
AbstractMetaModelDescriptor(java.lang.String identifier,
java.lang.String namespace,
java.lang.String name)
Creates a descriptor for a meta-model.
|
protected |
AbstractMetaModelDescriptor(java.lang.String identifier,
java.lang.String baseNamespace,
java.lang.String ePackageNsURIPostfixPattern,
java.lang.String name)
Creates a descriptor for a meta-model.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAssociatedContentTypeId(java.lang.String contentTypeId)
Adds associated content type to the meta-model described by this
meta-model
descriptor. |
boolean |
equals(java.lang.Object obj) |
IMetaModelDescriptor |
getBaseDescriptor()
Returns the
descriptor of the base meta-model behind the described meta-model. |
protected java.net.URI |
getBaseNamespaceURI() |
java.util.List<java.lang.String> |
getCompatibleContentTypeIds()
Returns a collection of content type ids which are supported by older but all the same compatible versions of the
meta-model described by this
meta-model descriptor. |
java.util.List<java.net.URI> |
getCompatibleNamespaceURIs()
Returns a collection of namespace
URIs which refer to older but all the same compatible versions of the
meta-model described by this meta-model descriptor. |
java.util.Collection<IMetaModelDescriptor> |
getCompatibleResourceVersionDescriptors()
Returns a collection of
meta-model descriptors identifying resource versions which
are older but all the same compatible with the meta-model described by this meta-model descriptor. |
java.util.List<java.lang.String> |
getContentTypeIds()
Returns the identifiers of all
content types which are
associated with the described meta-model. |
java.lang.String |
getCustomURIScheme()
Returns the scheme of the custom URIs that the described meta-model uses in cross-document references and as
proxy URIs.
|
abstract java.lang.String |
getDefaultContentTypeId()
Returns the identifier of the default
content type for the
described meta-model. |
org.eclipse.emf.ecore.EFactory |
getEFactory()
Deprecated.
|
org.eclipse.emf.ecore.EPackage |
getEPackage()
Deprecated.
|
java.lang.String |
getEPackageNsURIPattern()
Deprecated.
|
org.eclipse.emf.ecore.EPackage.Registry |
getEPackageRegistry() |
java.util.Collection<org.eclipse.emf.ecore.EPackage> |
getEPackages()
Returns the set of
EPackages which are associated with the described
meta-model. |
java.lang.String |
getIdentifier()
Returns the identifier of the described meta-model.
|
java.lang.String |
getName()
Returns the name of the described meta-model.
|
java.lang.String |
getNamespace()
Returns the namespace (as a string) of the described meta-model.
|
java.net.URI |
getNamespaceURI()
Returns the namespace
URI of the described meta-model. |
protected java.lang.String |
getNsPostfix() |
int |
getOrdinal()
Deprecated.
|
org.eclipse.emf.ecore.EFactory |
getRootEFactory()
Returns the root
EFactory which is associated with the described
meta-model. |
org.eclipse.emf.ecore.EPackage |
getRootEPackage()
Returns the root
EPackage which is associated with the described
meta-model. |
protected java.lang.String |
getRootEPackageContentTypeId()
Deprecated.
This method could be used to implement
getDefaultContentTypeId(). It is however not
recommended to do so because the content type id retrieval strategy implemented here has the side
effect of that it triggers a full initialization of the metamodel's root EPackage and all
dependent EPackages. This can have significant impact on runtime performance, e.g., in the UI
when metamodel descriptors are used to determine if some common
navigator content needs to be activated or not, and may cause that the EPackages of a
metamodel become initialized even though not a single instance of that metamodel exists in the
workspace. |
int |
hashCode() |
protected void |
initContentTypeIds() |
protected void |
initEPackageNsURIPattern()
Initializes the URI pattern used for determining if an EPackage belongs to the meta-model or not.
|
protected void |
initEPackages() |
protected void |
initName() |
protected void |
initNamespace()
Initializes the meta-model's namespace.
|
protected void |
initRootEPackage() |
boolean |
isEPackageRegistered()
Deprecated.
|
boolean |
matchesEPackageNsURIPattern(java.lang.String uri)
Returns true if the passed in URI matches the namespace pattern for the EPackages associated of with the
described meta-model.
|
protected void |
setEPackageRegistry(org.eclipse.emf.ecore.EPackage.Registry ePkgRegistry) |
java.lang.String |
toString() |
protected static final java.lang.String URI_SEGMENT_SEPARATOR
protected java.net.URI fBaseNamespaceURI
protected AbstractMetaModelDescriptor(java.lang.String identifier,
java.lang.String namespace,
java.lang.String name)
EPackage, i.e., a
root EPackage without sub-packages.identifier - The identifier of the described meta-model. A unique identifier used for referencing the meta-model
from within an extension point.namespace - The namespace of the described meta-model.name - The name of the described meta-model.getRootEPackage()protected AbstractMetaModelDescriptor(java.lang.String identifier,
java.lang.String baseNamespace,
java.lang.String ePackageNsURIPostfixPattern,
java.lang.String name)
EPackages.identifier - The identifier of the described meta-model. A unique identifier used for referencing the meta-model
from within an extension point.baseNamespace - Typically the namespace of the root EPackage.ePackageNsURIPostfixPattern - A regular expression when appended to the baseNamespace will match the namespace of the meta-model
sub-packages.name - The name of the described meta-model.getRootEPackage()protected AbstractMetaModelDescriptor(java.lang.String identifier,
java.lang.String baseNamespace,
MetaModelVersionData versionData)
identifier - The identifier of the described meta-model. A unique identifier used for referencing the meta-model
from within an extension point.baseNamespace - The base namespace of the described meta-model. Is equal to the full namespace if no version data is
provided.versionData - Data describing the meta-model version details.public org.eclipse.emf.ecore.EPackage.Registry getEPackageRegistry()
protected void setEPackageRegistry(org.eclipse.emf.ecore.EPackage.Registry ePkgRegistry)
public java.lang.String getIdentifier()
IMetaModelDescriptorIMetaModelDescriptor.getName()). The identifier can also be used to reference the
described meta-model from within an extension point.
Uses a specific identifier instead of namespace URI in order to distinguish available meta-model descriptors.
Namespace URI is revision dependent since when the minor version of a release changes, the namespace URI changes. As a consequence, it is more safe to refer a meta-model descriptor with its identifier (e.g. in a project's preferences).
getIdentifier in interface IMetaModelDescriptorpublic java.net.URI getNamespaceURI()
IMetaModelDescriptorURI of the described meta-model. The namespace URI is a unique identifier
used to link the meta-model description to registered EMF artifacts like the root
EPackage and the EFactory.getNamespaceURI in interface IMetaModelDescriptorURI of the described meta-model.protected void initNamespace()
protected java.net.URI getBaseNamespaceURI()
protected java.lang.String getNsPostfix()
public java.lang.String getNamespace()
IMetaModelDescriptorEPackage
and the EFactory.getNamespace in interface IMetaModelDescriptorpublic java.lang.String getName()
IMetaModelDescriptorgetName in interface IMetaModelDescriptorprotected void initName()
public IMetaModelDescriptor getBaseDescriptor()
IMetaModelDescriptordescriptor of the base meta-model behind the described meta-model. When
multiple implementations of different versions of the same meta-model exist each of them is described by a
version-specific meta-model descriptor. In this case, the base meta-model encompasses the common aspects of all
meta-model versions and the descriptor of it, if there is any, is what is returned by this method.getBaseDescriptor in interface IMetaModelDescriptornull if the described
meta-model has no base meta-model.public java.lang.String getCustomURIScheme()
IMetaModelDescriptorgetCustomURIScheme in interface IMetaModelDescriptornull if it uses standard
URIs (e.g., platform:/resource, file:, etc.) instead.@Deprecated public int getOrdinal()
IMetaModelDescriptornull is
returned.getOrdinal in interface IMetaModelDescriptornull if the described meta-model is not a
concrete meta-model version.@Deprecated public java.lang.String getEPackageNsURIPattern()
IMetaModelDescriptorgetEPackageNsURIPattern in interface IMetaModelDescriptorpublic boolean matchesEPackageNsURIPattern(java.lang.String uri)
IMetaModelDescriptormatchesEPackageNsURIPattern in interface IMetaModelDescriptorprotected void initEPackageNsURIPattern()
public java.util.Collection<org.eclipse.emf.ecore.EPackage> getEPackages()
IMetaModelDescriptorEPackages which are associated with the described
meta-model.getEPackages in interface IMetaModelDescriptorprotected void initEPackages()
public org.eclipse.emf.ecore.EPackage getRootEPackage()
IMetaModelDescriptorEPackage which is associated with the described
meta-model. An EPackage is considered to be a meta-model's root EPackage if it has
the same namespace as the latter.getRootEPackage in interface IMetaModelDescriptorprotected void initRootEPackage()
@Deprecated public org.eclipse.emf.ecore.EPackage getEPackage()
getEPackage in interface IMetaModelDescriptor@Deprecated public boolean isEPackageRegistered()
IMetaModelDescriptorEPackage associated with the described meta-model is
registered. The EPackage.Registry is to be consolidated if the
top-level package is actually registered (see also IMetaModelDescriptor.getRootEPackage()).isEPackageRegistered in interface IMetaModelDescriptortrue if the associated top-level EPackage is registered else false;public org.eclipse.emf.ecore.EFactory getRootEFactory()
IMetaModelDescriptorEFactory which is associated with the described
meta-model. An EFactory is considered to be a meta-model's root EFactory if the
EPackage it belongs to is the meta-model's root EPackage
.getRootEFactory in interface IMetaModelDescriptorIMetaModelDescriptor.getRootEPackage()@Deprecated public org.eclipse.emf.ecore.EFactory getEFactory()
getEFactory in interface IMetaModelDescriptorpublic java.util.List<java.lang.String> getContentTypeIds()
IMetaModelDescriptorcontent types which are
associated with the described meta-model.getContentTypeIds in interface IMetaModelDescriptorprotected void initContentTypeIds()
public abstract java.lang.String getDefaultContentTypeId()
IMetaModelDescriptorcontent type for the
described meta-model.
The default content type identifier typically is the content type identifier which has been specified in the
generator model options for the root package of the described meta-model and is
available on the root package's static #eCONTENT_TYPE field.
getDefaultContentTypeId in interface IMetaModelDescriptor#getERootPackage()public void addAssociatedContentTypeId(java.lang.String contentTypeId)
IMetaModelDescriptormeta-model
descriptor.addAssociatedContentTypeId in interface IMetaModelDescriptor@Deprecated protected java.lang.String getRootEPackageContentTypeId()
getDefaultContentTypeId(). It is however not
recommended to do so because the content type id retrieval strategy implemented here has the side
effect of that it triggers a full initialization of the metamodel's root EPackage and all
dependent EPackages. This can have significant impact on runtime performance, e.g., in the UI
when metamodel descriptors are used to determine if some common
navigator content needs to be activated or not, and may cause that the EPackages of a
metamodel become initialized even though not a single instance of that metamodel exists in the
workspace.root EPackage, if any.root EPackage, or and empty
string if no such is available.public java.util.List<java.lang.String> getCompatibleContentTypeIds()
IMetaModelDescriptormeta-model descriptor.getCompatibleContentTypeIds in interface IMetaModelDescriptorIMetaModelDescriptor.getContentTypeIds()public java.util.List<java.net.URI> getCompatibleNamespaceURIs()
IMetaModelDescriptorURIs which refer to older but all the same compatible versions of the
meta-model described by this meta-model descriptor.getCompatibleNamespaceURIs in interface IMetaModelDescriptorURIs.IMetaModelDescriptor.getNamespaceURI()public java.util.Collection<IMetaModelDescriptor> getCompatibleResourceVersionDescriptors()
IMetaModelDescriptormeta-model descriptors identifying resource versions which
are older but all the same compatible with the meta-model described by this meta-model descriptor.getCompatibleResourceVersionDescriptors in interface IMetaModelDescriptordescriptors.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object