public interface IMetamodelExtensions
The known extensions are the following:
IStereotype
)ITagType
)INoteType
)IExternDocumentType
)Modifier and Type | Method and Description |
---|---|
IExternDocumentType |
getExternDocumentType(Class<? extends IElement> metaclass,
String name)
Used to access a specific external document type.
|
ObList<IExternDocumentType> |
getExternDocumentTypes(Class<? extends IElement> metaclass)
Returns all the external document types brought by deployed modules.
|
String |
getModule(INoteType noteType)
Return the name of the module that owns a note type.
|
String |
getModule(IStereotype stereotype)
Return the name of the module that owns a stereotype.
|
String |
getModule(ITagType tagType)
Return name of the module that owns a tageed value type.
|
INoteType |
getNoteType(Class<? extends IElement> metaclass,
String name)
Used to access a specific note type.
|
ObList<INoteType> |
getNoteTypes(Class<? extends IElement> metaclass)
Returns all the note types brought by deployed modules.
|
IStereotype |
getStereotype(Class<? extends IElement> metaclass,
String name)
Used to access a specific stereotype.
|
ObList<IStereotype> |
getStereotypes(Class<? extends IElement> metaclass)
Returns all the stereotypes brought by deployed modules.
|
ITagType |
getTagType(Class<? extends IElement> metaclass,
String name)
Used to access a specific tag type.
|
ObList<ITagType> |
getTagTypes(Class<? extends IElement> metaclass)
Returns all the tag types brought by deployed modules.
|
ObList<IStereotype> getStereotypes(Class<? extends IElement> metaclass)
For example, to get all the stereotypes that are defined on a class, use the following code:
IMetamodelExtensions extensions = Modelio.getInstance().getModelingSession().getMetamodelExtensions();
ObList
It's also possible to give an abstract metaclass, such as INameSpace.
metaclass
- The Class
on which the stereotypes can be accessedIStereotype
or an empty list.IStereotype getStereotype(Class<? extends IElement> metaclass, String name) throws StereotypeNotFoundException
With a right name and the metaclass on which the stereotype can be accessed, this method can return the right stereotype.
For example, to get the 'metaclass' stereotype defined on a class, the following code can be used:
IMetamodelExtensions extensions = Modelio.getInstance().getModelingSession().getMetamodelExtensions();
try {
IStereotype metaclassStereotype = extensions.getStereotype (IClass.class, "metaclass");
} catch ( StereotypeNotFoundException e ) {
Modelio.getInstance().getLogService().error(this.mdac, e);
}
It's also possible to give an abstract metaclass, such as INameSpace.
This method throws a StereotypeNotFoundException
if the stereotype is not found.
metaclass
- The Class
on which the stereotype can be accessedname
- The name of the stereotypeStereotypeNotFoundException
- if the stereotype is not found.ObList<INoteType> getNoteTypes(Class<? extends IElement> metaclass)
For example, to get all the note types that are defined on a class, use the following code:
IMetamodelExtensions extensions = Modelio.getInstance().getModelingSession().getMetamodelExtensions();
ObList
It's also possible to give an abstract metaclass, such as INameSpace.
INoteType getNoteType(Class<? extends IElement> metaclass, String name) throws NoteTypeNotFoundException
With a right name and the metaclass on which the note can be accessed, this method can return the right note type.
For example, to get the 'description' note type defined on a model element, the following code can be used:
IMetamodelExtensions extensions = Modelio.getInstance().getModelingSession().getMetamodelExtensions();
try {
INoteType descriptionNoteType = extensions.getNoteType (IModelElement.class, "description");
} catch ( NoteTypeNotFoundException e ) {
Modelio.getInstance().getLogService().error(this.mdac, e);
}
It's also possible to give an abstract metaclass, such as INameSpace.
This method throws a NoteTypeNotFoundException
if the note type is not found.
metaclass
- The Class
on which the note can be accessedname
- The name of the note typeNoteTypeNotFoundException
- if the note type is not found.ObList<ITagType> getTagTypes(Class<? extends IElement> metaclass)
For example, to get all the tag types that are defined on a class, use the following code:
IMetamodelExtensions extensions = Modelio.getInstance().getModelingSession().getMetamodelExtensions();
ObList
It's also possible to give an abstract metaclass, such as INameSpace.
ITagType getTagType(Class<? extends IElement> metaclass, String name) throws TagTypeNotFoundException
With a right name and the metaclass on which the tagged value can be accessed, this method can return the right tag type.
For example, to get the 'design' tag type defined on a package, the following code can be used:
IMetamodelExtensions extensions = Modelio.getInstance().getModelingSession().getMetamodelExtensions();
try {
ITagType designTagType = extensions.getTagType (IPackage.class, "design");
} catch ( TagTypeNotFoundException e ) {
Modelio.getInstance().getLogService().error(this.mdac, e);
}
It's also possible to give an abstract metaclass, such as INameSpace.
This method throws a TagTypeNotFoundException
if the tag type is not found.
metaclass
- The Class
on which the tagged value can be accessedname
- The name of the tag typeTagTypeNotFoundException
- if the tag type is not found.String getModule(IStereotype stereotype)
stereotype
- the stereotype for which the module owner is wantedString getModule(INoteType noteType)
noteType
- the note type for which the module owner is wantedString getModule(ITagType tagType)
tagType
- the tagged value type for which the module owner is wantedObList<IExternDocumentType> getExternDocumentTypes(Class<? extends IElement> metaclass)
For example, to get all the external document types that are defined on a class, use the following code:
IModelingSession modelingSession = ... ;
IMetamodelExtensions extensions = modelingSession.getModel().getMetamodelExtensions();
List
It's also possible to give an abstract metaclass, such as INameSpace.
metaclass
- The Class
on which the note types can be accessedIExternDocumentType
or an empty list.IExternDocumentType getExternDocumentType(Class<? extends IElement> metaclass, String name) throws DocumentTypeNotFoundException
With a right name and the metaclass on which the note can be accessed, this method can return the right external document type.
For example, to get the 'description' external document type defined on a model element, the following code can be used:
IModelingSession modelingSession = ... ;
IMetamodelExtensions extensions = modelingSession.getModel().getMetamodelExtensions();
try {
IExternDocumentType descriptionNoteType = getExternDocumentType (IModelElement.class, "description");
} catch ( NoteTypeNotFoundException e ) {
Modelio.getInstance().getLogService().error(this.mdac, e);
}
It's also possible to give an abstract metaclass, such as INameSpace.
This method throws a NoteTypeNotFoundException
if the external document type is not found.
metaclass
- The Class
on which the external document can be accessedname
- The name of the external document typeDocumentTypeNotFoundException
- if the external document type is not found.