Class 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 exists
      static 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.
      private static boolean isEqual​(java.lang.Object obj1, java.lang.Object obj2)  
      static void removeExtension​(MDObject object, java.lang.String extensionSource)
      Completely removes given extension from element
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
      • isEqual

        private static boolean isEqual​(@CheckForNull
                                       java.lang.Object obj1,
                                       @CheckForNull
                                       java.lang.Object obj2)
        Parameters:
        obj1 - First object.
        obj2 - Second object.
        Returns:
        true of both objects are nulls or equal