Class MDExtensions
- java.lang.Object
-
- com.nomagic.magicdraw.foundation.util.MDExtensions
-
public class MDExtensions extends java.lang.Object
Helper methods to work with element extensions (MDExtension)
-
-
Constructor Summary
Constructors Constructor Description MDExtensions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static MDExtension
createMDExtension(MDObject object, java.lang.String extensionSource)
Creates new element extension, but only if it not yet existsstatic java.util.List<org.eclipse.emf.ecore.EObject>
getExtensionContents(MDObject object, java.lang.String source)
Get MDExtension contents for the given element.static MDExtension
getMDExtension(MDObject object, java.lang.String source)
Get MDExtension for the given source.static java.util.List<MDExtension>
getMDExtensions(MDObject object)
Get MDExtensions of element.static void
removeExtension(MDObject object, java.lang.String extensionSource)
Completely removes given extension from element
-
-
-
Method Detail
-
getMDExtensions
@CheckForNull public static java.util.List<MDExtension> getMDExtensions(MDObject object)
Get MDExtensions of element.- Parameters:
object
- MDObject.- Returns:
- MDExtensions.
-
getExtensionContents
@CheckForNull public static java.util.List<org.eclipse.emf.ecore.EObject> getExtensionContents(MDObject object, java.lang.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 java.lang.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
public static MDExtension createMDExtension(MDObject object, java.lang.String extensionSource)
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
public static void removeExtension(MDObject object, java.lang.String extensionSource)
Completely removes given extension from element
-
-