Class MDExtensions

java.lang.Object
com.nomagic.magicdraw.foundation.util.MDExtensions

public class MDExtensions extends Object
Helper methods to work with element extensions (MDExtension)
  • Constructor Details

    • MDExtensions

      public MDExtensions()
  • Method Details

    • getMDExtensions

      @CheckForNull public static List<MDExtension> getMDExtensions(MDObject object)
      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

      public static MDExtension createMDExtension(MDObject object, String extensionSource)
      Creates new element extension, but only if it not yet exists
      Parameters:
      object - MDObject to create extension for
      extensionSource - extension source string (identifier)
      Returns:
      existing or new created extension.
    • removeExtension

      public static void removeExtension(MDObject object, String extensionSource)
      Completely removes given extension from element