Class MdUtil


  • public class MdUtil
    extends Object
    Utility class
    • Constructor Detail

      • MdUtil

        public MdUtil()
    • Method Detail

      • getFullyQualifiedName

        public static org.eclipse.xtext.naming.QualifiedName getFullyQualifiedName​(MdObject mdObject)
        Returns the fully qualified name of an MdObject, or null if the name cannot be determined. Some examples of the returned names:
        • Сonfiguration1 (only Configuration objects may have a one-segment name)
        • Catalog.Catalog1
        • Catalog.Catalog1.Attribute.Attribute1
        Parameters:
        mdObject - not null
        Returns:
        the fully qualified name of an MdObject, or null if the name cannot be determined
      • getTopMdObjectFullyQualifiedName

        public static org.eclipse.xtext.naming.QualifiedName getTopMdObjectFullyQualifiedName​(org.eclipse.emf.ecore.EClass eClass,
                                                                                              String name)
        Gets FQN of the MD object identified by the given EClass and name.
        Parameters:
        eClass - the EClass of the object, may not be null, must be descendant of MD_OBJECT.
        name - the name of the object or null if is not applicable.
        Returns:
        the FQN, not null.
      • getFullyQualifiedNameRu

        public static org.eclipse.xtext.naming.QualifiedName getFullyQualifiedNameRu​(MdObject mdObject)
        Returns the fully qualified nameRu of an MdObject, or null if the name cannot be determined. Some examples of the returned names:
        • Сonfiguration1 (only Configuration objects may have a one-segment name)
        • Catalog.Catalog1
        • Catalog.Catalog1.Attribute.Attribute1
        Parameters:
        mdObject - not null
        Returns:
        the fully qualified nameRu of an MdObject, or null if the name cannot be determined
      • isUserSettable

        public static boolean isUserSettable​(org.eclipse.emf.ecore.EStructuralFeature feature)
        Returns whether the given feature is settable by the user (i.e. not "special").
        Parameters:
        feature - not null
        Returns:
        true if the given feature is settable by the user, and false if the feature is "special"
      • getModuleName

        public static String getModuleName​(org.eclipse.emf.ecore.EReference reference)
        Gets the name of the module which is referenced by the given object.
        Parameters:
        reference - the reference.
        Returns:
        the module name.
      • isMobileApplicationUsePurposes

        public static boolean isMobileApplicationUsePurposes​(IV8Project v8Project)
        Checks if the specified IV8Project has only one mobile application use purpose.
        Parameters:
        v8Project - the IV8Project for check, can be null
        Returns:
        true if the given IV8Project has only one mobile application use purpose and false if the given IV8Project is null or has empty use purposes or has personal computer use purpose
      • getAllProducingTypes

        public static Collection<TypeItem> getAllProducingTypes​(MdObject mdObject)
        Gets collection of producing type of mdObject
        Parameters:
        mdObject - object for getting it producing types, can't be null
        Returns:
        collection of producing type of mdObject, never null
      • createEObjectTrieForTopModelObjects

        public static EObjectTrie createEObjectTrieForTopModelObjects​(Collection<org.eclipse.emf.ecore.EObject> topModelObjects,
                                                                      org.eclipse.xtext.naming.IQualifiedNameProvider qualifiedNameProvider)
        Creates an EObjectTrie from the given collection of top model objects.
        Parameters:
        topModelObjects - the given collection of top model objects, cannot be null
        qualifiedNameProvider - the qualified name provider, cannot be null
        Returns:
        the created EObjectTrie, never null
      • hasRealDatabasePresentation

        public static boolean hasRealDatabasePresentation​(MdObject object)
        Checks that object has real association with database
        Parameters:
        object - checking object, cannot be null
        Returns:
        true if object has presentation in database, false otherwise
      • getDefaultStyleElementTypeValue

        public static Value getDefaultStyleElementTypeValue​(StyleElementType styleElementType,
                                                            IV8Project v8project)
        Returns default value for specified element type.
        Parameters:
        styleElementType - the style elemet type, cannot be null
        v8project - the v8 project, cannot be null
        Returns:
        the default value, can be null
      • isSuppressSettingsFeature

        public static boolean isSuppressSettingsFeature​(org.eclipse.emf.ecore.EStructuralFeature reference)
        Returns true if EStructuralFeature represents a suppression object
        Parameters:
        reference - the feature reference, cannot be null
        Returns:
        true if EStructuralFeature represents a suppression object
      • getFullyQualifiedName

        public static String getFullyQualifiedName​(Field field)
        Returns the fully qualified name of an Field, or null if the name cannot be determined.
        Parameters:
        field - Field, not null
        Returns:
        the fully qualified name of an Field, or null if the name cannot be determined
      • getFullyQualifiendNameRu

        public static String getFullyQualifiendNameRu​(Field field)
        Returns the Russian fully qualified name of an Field, or null if the name cannot be determined.
        Parameters:
        field - Field, not null
        Returns:
        the Russian fully qualified name of an Field, or null if the name cannot be determined
      • getProxySupportsFullQualifiedName

        public static org.eclipse.xtext.naming.QualifiedName getProxySupportsFullQualifiedName​(MdObject mdObject)
        Returns md-object qualified name. Proxy supports.
        Parameters:
        mdObject - the md-object, cannot be null, may be proxy
        Returns:
        the qualified name, cannot be null
      • isIndependentObject

        public static boolean isIndependentObject​(Object object)
        Checks object is independent for StandaloneContent.
        Parameters:
        object - the object, cannot be null
        Returns:
        true is independent, false otherwise
      • getMdName

        public static String getMdName​(MdObject mdObject,
                                       String code)
        Returns the name of the MdObject. If object synonym exists then return synonym, otherwise return object's name
        Parameters:
        mdObject - the MdObject, cannot be null
        code - the language code, cannot be null
        Returns:
        the MdObject name