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
URI s 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 descriptor s 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 type s 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
EPackage s 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 EPackage s. This can have significant impact on runtime performance, e.g., in the UI
when metamodel descriptor s are used to determine if some common
navigator content needs to be activated or not, and may cause that the EPackage s 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)
EPackage
s.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()
IMetaModelDescriptor
IMetaModelDescriptor.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 IMetaModelDescriptor
public java.net.URI getNamespaceURI()
IMetaModelDescriptor
URI
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 IMetaModelDescriptor
URI
of the described meta-model.protected void initNamespace()
protected java.net.URI getBaseNamespaceURI()
protected java.lang.String getNsPostfix()
public java.lang.String getNamespace()
IMetaModelDescriptor
EPackage
and the EFactory
.getNamespace
in interface IMetaModelDescriptor
public java.lang.String getName()
IMetaModelDescriptor
getName
in interface IMetaModelDescriptor
protected void initName()
public IMetaModelDescriptor getBaseDescriptor()
IMetaModelDescriptor
descriptor
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 IMetaModelDescriptor
null
if the described
meta-model has no base meta-model.public java.lang.String getCustomURIScheme()
IMetaModelDescriptor
getCustomURIScheme
in interface IMetaModelDescriptor
null
if it uses standard
URIs (e.g., platform:/resource, file:, etc.) instead.@Deprecated public int getOrdinal()
IMetaModelDescriptor
null
is
returned.getOrdinal
in interface IMetaModelDescriptor
null
if the described meta-model is not a
concrete meta-model version.@Deprecated public java.lang.String getEPackageNsURIPattern()
IMetaModelDescriptor
getEPackageNsURIPattern
in interface IMetaModelDescriptor
public boolean matchesEPackageNsURIPattern(java.lang.String uri)
IMetaModelDescriptor
matchesEPackageNsURIPattern
in interface IMetaModelDescriptor
protected void initEPackageNsURIPattern()
public java.util.Collection<org.eclipse.emf.ecore.EPackage> getEPackages()
IMetaModelDescriptor
EPackage
s which are associated with the described
meta-model
.getEPackages
in interface IMetaModelDescriptor
protected void initEPackages()
public org.eclipse.emf.ecore.EPackage getRootEPackage()
IMetaModelDescriptor
EPackage
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 IMetaModelDescriptor
protected void initRootEPackage()
@Deprecated public org.eclipse.emf.ecore.EPackage getEPackage()
getEPackage
in interface IMetaModelDescriptor
@Deprecated public boolean isEPackageRegistered()
IMetaModelDescriptor
EPackage
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 IMetaModelDescriptor
true if the associated top-level EPackage is registered else false
;
public org.eclipse.emf.ecore.EFactory getRootEFactory()
IMetaModelDescriptor
EFactory
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 IMetaModelDescriptor
IMetaModelDescriptor.getRootEPackage()
@Deprecated public org.eclipse.emf.ecore.EFactory getEFactory()
getEFactory
in interface IMetaModelDescriptor
public java.util.List<java.lang.String> getContentTypeIds()
IMetaModelDescriptor
content type
s which are
associated with the described meta-model.getContentTypeIds
in interface IMetaModelDescriptor
protected void initContentTypeIds()
public abstract java.lang.String getDefaultContentTypeId()
IMetaModelDescriptor
content 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)
IMetaModelDescriptor
meta-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 EPackage
s. This can have significant impact on runtime performance, e.g., in the UI
when metamodel descriptor
s are used to determine if some common
navigator content needs to be activated or not, and may cause that the EPackage
s 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()
IMetaModelDescriptor
meta-model descriptor
.getCompatibleContentTypeIds
in interface IMetaModelDescriptor
IMetaModelDescriptor.getContentTypeIds()
public java.util.List<java.net.URI> getCompatibleNamespaceURIs()
IMetaModelDescriptor
URI
s which refer to older but all the same compatible versions of the
meta-model described by this meta-model descriptor
.getCompatibleNamespaceURIs
in interface IMetaModelDescriptor
URI
s.IMetaModelDescriptor.getNamespaceURI()
public java.util.Collection<IMetaModelDescriptor> getCompatibleResourceVersionDescriptors()
IMetaModelDescriptor
meta-model descriptor
s identifying resource versions which
are older but all the same compatible with the meta-model described by this meta-model descriptor
.getCompatibleResourceVersionDescriptors
in interface IMetaModelDescriptor
descriptor
s.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object