Class MDExtensions


  • public class MDExtensions
    extends java.lang.Object
    Helper methods to work with element extensions (MDExtension)
    • Constructor Detail

      • MDExtensions

        public MDExtensions()
    • 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 for
        extensionSource - 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