Class MDExtensions
java.lang.Object
com.nomagic.magicdraw.foundation.util.MDExtensions
Helper methods to work with element extensions (MDExtension)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic MDExtension
createMDExtension
(MDObject object, String extensionSource) Creates new element extension, but only if it not yet existsstatic List<org.eclipse.emf.ecore.EObject>
getExtensionContents
(MDObject object, String source) Get MDExtension contents for the given element.static MDExtension
getMDExtension
(MDObject object, String source) Get MDExtension for the given source.static List<MDExtension>
getMDExtensions
(MDObject object) Get MDExtensions of element.static void
removeExtension
(MDObject object, String extensionSource) Completely removes given extension from element
-
Constructor Details
-
MDExtensions
public MDExtensions()
-
-
Method Details
-
getMDExtensions
Get MDExtensions of element.- Parameters:
object
- MDObject.- Returns:
- MDExtensions.
-
getExtensionContents
@CheckForNull public static List<org.eclipse.emf.ecore.EObject> getExtensionContents(MDObject object, String source) Get MDExtension contents for the given element.- Parameters:
object
- MDObject.source
- extension source string (identifier)- Returns:
- contents of MDExtension
-
getMDExtension
@CheckForNull public static MDExtension getMDExtension(MDObject object, @CheckForNull String source) Get MDExtension for the given source.- Parameters:
object
- MDObject.source
- extension source.- Returns:
- MDExtension of the given element with provided source set or null, if no such extension exists
-
createMDExtension
Creates new element extension, but only if it not yet exists- Parameters:
object
- MDObject to create extension forextensionSource
- extension source string (identifier)- Returns:
- existing or new created extension.
-
removeExtension
Completely removes given extension from element
-