public interface Metamodel extends Comparable<Object>
This interface is not intended to be implemented by clients.
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Object o)
Compare the metamodels based on their presentation name.
|
Model |
createModel()
Creates an empty model based on this metamodel.
|
ResourceSetModel |
createResourceSet(ResourceSet resourceSet)
Populates a model using the specified resource set.
|
MetamodelConfiguration |
getConfiguration()
Returns the configuration from which this metamodel originates.
|
EClassifier |
getEClassifier(String name)
Returns the
EClassifier of specified name defined in this metamodel. |
EList<EClassifier> |
getEClassifiers()
Returns the list of
EClassifier s defined in this metamodel. |
EPackage |
getEPackage()
Deprecated.
As of 3.4.0, use getEPackages(), since a metamodel may be defined using many packages.
|
Collection<EPackage> |
getEPackages()
Returns the
EPackage s declaring this metamodel. |
MetamodelManager |
getManager()
Returns the manager to which the metamodel is registered.
|
ConnectorDescriptor |
getModelReaderDescriptor(String name)
Returns the connector, used to read a model, that matches the specified name.
|
List<ConnectorDescriptor> |
getModelReaderDescriptors()
Returns the registered connectors that can be used to read a model.
|
ConnectorDescriptor |
getModelWriterDescriptor(String name)
Returns the connector, used to write a model, that matches the specified name.
|
List<ConnectorDescriptor> |
getModelWriterDescriptors()
Returns the registered connectors that can be used to write a model.
|
String |
getName()
Returns the name of this metamodel ("UML" for example).
|
String |
getPresentationName()
Returns the display name of this metamodel, which may include a name and
a metamodel version ("UML 2.1" for example).
|
ConnectorDescriptor |
getResourceSetReaderDescriptor(String name)
Returns the connector, used to read a resource set, that matches the specified name.
|
List<ConnectorDescriptor> |
getResourceSetReaderDescriptors()
Returns the registered connectors that can be used to read a resource set.
|
String |
getUniqueID()
Returns the ID which uniquely identifies this metamodel.
|
String |
getVersion()
Returns the version of this metamodel ("2.1" for example), if any.
|
boolean |
isAssignableFrom(Metamodel metamodel)
Determines if the metamodel represented by this
Metamodel object
is the same as the specified Metamodel parameter,
and if the applied metamodel extensions are the same or a subset of the ones applied on the Metamodel parameter. |
Model |
readModel(String readerName,
String uri)
Creates and populates a model using the specified connector information.
|
Model |
readModel(String readerName,
String uri,
Map<String,?> options)
Creates and populates a model using the specified connector information.
|
ResourceSetModel |
readResourceSet(String readerName,
String uri,
Map<String,?> options)
Creates and populates a resource set using the specified connector information.
|
MetamodelManager getManager()
MetamodelConfiguration getConfiguration()
String getName()
String getVersion()
String
if no version is specified.String getPresentationName()
String getUniqueID()
Model createModel()
Model readModel(String readerName, String uri) throws CoreException
The reader name must match a connector registered on this metamodel. The uri is used to locate a resource from where the connector should read
information. If the connector expects a file, the uri must be a valid file path. Otherwise, it can be any connector specific resource locator,
including null
when the connector does not expect any uri.
This method is a facility and acts as a strict equivalent of calling createModel()
and then Model.read(String, String)
.
readerName
- the connector name to be used.uri
- an additional resource locator used by the connector to read the model (can be null
)CoreException
- if the model could not be loaded. Reasons include:
Model.read(String, String)
,
getModelReaderDescriptors()
,
ConnectorDescriptor.getKind()
Model readModel(String readerName, String uri, Map<String,?> options) throws CoreException
The reader name must match a connector registered on this metamodel. The uri is used to locate a resource from where the connector should read
information. If the connector expects a file, the uri must be a valid file path. Otherwise, it can be any connector specific resource locator,
including null
when the connector does not expect any uri.
This method is a facility and acts as a strict equivalent of calling createModel()
and then Model.read(String, String)
.
readerName
- the connector name to be used.uri
- an additional resource locator used by the connector to read the model (can be null
)options
- properties to configure the model reader.CoreException
- if the model could not be loaded. Reasons include:
Model.read(String, String)
,
getModelReaderDescriptors()
,
ConnectorDescriptor.getKind()
List<ConnectorDescriptor> getModelReaderDescriptors()
The connectors are returned in the order they are declared in the metamodels.xml
file of this metamodel. Additional connectors
(declared outside of the metamodel descriptor) are appended in an unpredictable order.
ConnectorDescriptor getModelReaderDescriptor(String name) throws CoreException
name
- the name of the connector to retrieve.CoreException
- if no reader connector matches this nameConnectorDescriptor.getName()
ResourceSetModel readResourceSet(String readerName, String uri, Map<String,?> options) throws CoreException
The reader name must match a connector registered on this metamodel. The uri is used to locate a resource from where the connector should read
information. If the connector expects a file, the uri must be a valid file path. Otherwise, it can be any connector specific resource locator,
including null
when the connector does not expect any uri.
readerName
- the connector name to be used.uri
- an additional resource locator used by the connector to read the model (can be null
)options
- properties to configure the model reader (can be null
).CoreException
- if the model could not be loaded. Reasons include:
ResourceSetModel.read(String, String, java.util.Map)
,
getResourceSetReaderDescriptors()
,
ConnectorDescriptor.getKind()
ResourceSetModel createResourceSet(ResourceSet resourceSet)
resourceSet
- an existing resource setList<ConnectorDescriptor> getResourceSetReaderDescriptors()
ConnectorDescriptor getResourceSetReaderDescriptor(String name) throws CoreException
name
- the name of the connector to retrieve.CoreException
- if no reader connector matches this nameConnectorDescriptor.getName()
List<ConnectorDescriptor> getModelWriterDescriptors()
The connectors are returned in the order they are declared in the metamodels.xml
file of this metamodel. Additional connectors
(declared outside of the metamodel descriptor) are appended in an unpredictable order.
ConnectorDescriptor getModelWriterDescriptor(String name) throws CoreException
name
- the name of the connector to retrieve.CoreException
- if no writer connector matches this nameConnectorDescriptor.getName()
int compareTo(Object o)
compareTo
in interface Comparable<Object>
getPresentationName()
EList<EClassifier> getEClassifiers()
EClassifier
s defined in this metamodel.EClassifier
s defined in this metamodel.EClassifier getEClassifier(String name)
EClassifier
of specified name defined in this metamodel.name
- the name of the classifier to look forEClassifier
of specified name defined in this metamodel, null
if none.@Deprecated EPackage getEPackage()
EPackage
declaring this metamodel.EPackage
declaring this metamodel.Collection<EPackage> getEPackages()
EPackage
s declaring this metamodel.EPackage
s declaring this metamodel.boolean isAssignableFrom(Metamodel metamodel)
Metamodel
object
is the same as the specified Metamodel
parameter,
and if the applied metamodel extensions are the same or a subset of the ones applied on the Metamodel
parameter.metamodel
- the metamodel to be checkedtrue
if the specified metamodel is the same as the receiver and if the applied metamodel extensions are compatible.