public interface ResourceSetModel
ResourceSetModel
holds EObject
instances contained in a ResourceSet
.
It is worth nothing instances part of the underlying ResourceSet
are computed only once, to guarantee decent performances. The
drawback is the instances indexing will not be updated if the ResourceSet
content is modified. This interface is thus designed to be
used in read-only use cases.
This interface is not intended to be implemented by clients.
Metamodel.readResourceSet(String, String, Map)
,
Metamodel.createResourceSet(ResourceSet)
Modifier and Type | Method and Description |
---|---|
<T extends EObject> |
getInstances()
Returns all model elements attached to this model.
|
<T extends EObject> |
getInstances(EClass type)
Returns all model elements of the specified type attached to this model.
|
<T extends EObject> |
getInstances(EClass type,
boolean includeSubTypes)
Returns all model elements of the specified type, or one of its sub types, attached to this model.
|
<T extends EObject> |
getInstances(String typeName)
Returns all model elements of the specified type attached to this model.
|
<T extends EObject> |
getInstances(String typeName,
boolean includeSubTypes)
Returns all model elements of the specified type, or one of its sub types, attached to this model.
|
Metamodel |
getMetamodel()
Returns the metamodel this model is based on.
|
<T extends EObject> |
getProfiledInstances(EClass type,
String profileName)
Returns model elements of the specified type attached to this model, which match the specified profile name.
|
<T extends EObject> |
getProfiledInstances(EClass type,
String profileName,
boolean includeSubTypes)
Returns all model elements of the specified type, or one of its sub types, attached to this model,
which match the specified profile name.
|
<T extends EObject> |
getProfiledInstances(String typeName,
String profileName)
Returns model elements of the specified type attached to this model, which match the specified profile name.
|
<T extends EObject> |
getProfiledInstances(String typeName,
String profileName,
boolean includeSubTypes)
Returns all model elements of the specified type, or one of its sub types, attached to this model,
which match the specified profile name.
|
ConnectorDescriptor |
getReader()
Returns the last connector used to read this model.
|
String |
getReadURI()
Returns the last uri used to read this model.
|
ResourceSet |
getResourceSet()
Returns the underlying resource set.
|
void |
read(String readerName,
String uri,
Map<String,?> options)
Reload the model using the specified connector information.
|
Metamodel getMetamodel()
ResourceSet getResourceSet()
void read(String readerName, String uri, Map<String,?> options) throws CoreException
The reader name must match a connector registered on the related 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:
Metamodel.getResourceSetReaderDescriptors()
,
ConnectorDescriptor.getKind()
ConnectorDescriptor getReader()
String getReadURI()
null
if the uri used was null
.<T extends EObject> MDWList<T> getInstances()
The returned list is a MDWList
so you can directly invoke scripts on the model elements. This list has no predictable order.
T
- the type of the instance to retrieve.EObject
contained in this model.<T extends EObject> MDWList<T> getInstances(String typeName)
The specified type name can be a fully qualified class ("com.sodius.mdw.metamodel.uml21.Class"
for example), or a simple name (
"Class"
), if this name is unique in the metamodel.
The returned list is a MDWList
so you can directly invoke scripts on the model elements. These elements are ordered the way they
were created and added to this model.
T
- the type of the instance to retrieve.typeName
- the type name of model elements to retrieve.EObject
contained in this model that matches the specified type.getInstances(String, boolean)
<T extends EObject> MDWList<T> getInstances(String typeName, boolean includeSubTypes)
The specified type name can be a fully qualified class ("com.sodius.mdw.metamodel.uml21.Classifier"
for example), or a simple name
("Classifier"
), if this name is unique in the metamodel.
The returned list is a MDWList
so you can directly invoke scripts on the model elements. This list has no predictable order.
T
- the type of the instance to retrieve.typeName
- the type name of model elements to retrieve.includeSubTypes
- determines whether to retrieve elements based on sub types.EObject
contained in this model that matches the specified type, or one of its sub types.getInstances(String)
<T extends EObject> MDWList<T> getInstances(EClass type)
The returned list is a MDWList
so you can directly invoke scripts on the model elements. These elements are ordered the way they
were created and added to this model.
T
- the type of the instance to retrieve.type
- the type of model elements to retrieve.EObject
contained in this model that matches the specified type.getInstances(EClass, boolean)
<T extends EObject> MDWList<T> getInstances(EClass type, boolean includeSubTypes)
The returned list is a MDWList
so you can directly invoke scripts on the model elements. This list has no predictable order.
T
- the type of the instance to retrieve.type
- the type of model elements to retrieve.includeSubTypes
- determines to retrieve elements based on sub types.EObject
contained in this model that matches the specified type, or one of its sub types.getInstances(String)
<T extends EObject> MDWList<T> getProfiledInstances(String typeName, String profileName)
The specified type name can be a fully qualified class ("com.sodius.mdw.metamodel.uml21.Class"
for example), or a simple name (
"Class"
), if this name is unique in the metamodel.
The returned list is a MDWList
so you can directly invoke scripts on the model elements. These elements are ordered the way they
were created and added to this model.
T
- the type of the instance to retrieve.typeName
- the type name of model elements to retrieve.profileName
- the name of the profile type the instances must match.EObject
contained in this model that matches the specified type.InvalidCallException
- if this API is not called during an MDWorkbench evaluation.getProfiledInstances(String, String, boolean)
<T extends EObject> MDWList<T> getProfiledInstances(String typeName, String profileName, boolean includeSubTypes)
The specified type name can be a fully qualified class ("com.sodius.mdw.metamodel.uml21.Classifier"
for example), or a simple name
("Classifier"
), if this name is unique in the metamodel.
The returned list is a MDWList
so you can directly invoke scripts on the model elements. This list has no predictable order.
T
- the type of the instance to retrieve.typeName
- the type name of model elements to retrieve.profileName
- the name of the profile type the instances must match.includeSubTypes
- determines to retrieve elements based on sub types.EObject
contained in this model that matches the specified type, or one of its sub types.InvalidCallException
- if this API is not called during an MDWorkbench evaluation.getProfiledInstances(String, String)
<T extends EObject> MDWList<T> getProfiledInstances(EClass type, String profileName)
The returned list is a MDWList
so you can directly invoke scripts on the model elements. These elements are ordered the way they
were created and added to this model.
T
- the type of the instance to retrieve.type
- the type of model elements to retrieve.profileName
- the name of the profile type the instances must match.EObject
contained in this model that matches the specified type.InvalidCallException
- if this API is not called during an MDWorkbench evaluation.getProfiledInstances(EClass, String, boolean)
<T extends EObject> MDWList<T> getProfiledInstances(EClass type, String profileName, boolean includeSubTypes)
The returned list is a MDWList
so you can directly invoke scripts on the model elements. This list has no predictable order.
T
- the type of the instance to retrieve.type
- the type of model elements to retrieve.profileName
- the name of the profile type the instances must match.includeSubTypes
- determines to retrieve elements based on sub types.EObject
contained in this model that matches the specified type, or one of its sub types.InvalidCallException
- if this API is not called during an MDWorkbench evaluation.getProfiledInstances(EClass, String)