Class BaseEmfUml2Helper

    • Field Detail

      • MAGICDRAW_SOURCE

        protected static final java.lang.String MAGICDRAW_SOURCE
        See Also:
        Constant Field Values
      • MD_PROPERTY_NAME

        public static final java.lang.String MD_PROPERTY_NAME
        See Also:
        Constant Field Values
      • mMDStandardProfiles

        private static final java.util.List<java.lang.String> mMDStandardProfiles
      • mProject

        private final Project mProject
      • mUml2DataTypeMap

        private com.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2DataTypeMap mUml2DataTypeMap
      • mMappedElements

        private final java.util.Set<java.lang.Object> mMappedElements
      • mSkippedElements

        private final java.util.Set<java.lang.Object> mSkippedElements
      • mRemovableElements

        private final java.util.Set<java.lang.Object> mRemovableElements
      • mFinalizeActivities

        private final java.util.List<FinalizeActivity> mFinalizeActivities
      • mPersistenceHelper

        private final com.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2PersistenceHelper mPersistenceHelper
      • mCreatedElementsIDData

        private final java.util.Map<java.lang.Object,​com.nomagic.magicdraw.emfuml2xmi.export.CreatedElementData> mCreatedElementsIDData
      • mIDManager

        private final com.nomagic.magicdraw.emfuml2xmi.export.BaseEmfUml2IDManager mIDManager
      • mChangedIDs

        private final java.util.Set<java.lang.String> mChangedIDs
        Set of changed original ids
      • mSetIDs

        private final java.util.Map<java.lang.String,​java.lang.Object> mSetIDs
        Map of changed ids: id --> eElement ID IS CHANGED FOR MAGICDRAW ELEMENT
    • Constructor Detail

      • BaseEmfUml2Helper

        public BaseEmfUml2Helper​(Project project,
                                 com.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2PersistenceHelper persistenceHelper,
                                 com.nomagic.magicdraw.emfuml2xmi.export.BaseEmfUml2IDManager idManager,
                                 BaseEmfOptionsGroup emfOptionsGroup,
                                 EmfUml2Logger logger)
    • Method Detail

      • getUml2DataTypeMap

        public com.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2DataTypeMap getUml2DataTypeMap()
        Returns datatype map
        Specified by:
        getUml2DataTypeMap in interface BaseEmfUml2Helper
        Returns:
        datatypes map
      • createDataTypeMap

        protected abstract com.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2DataTypeMap createDataTypeMap()
      • getMDStandardProfiles

        public static java.util.List getMDStandardProfiles()
      • markMappedElement

        @OpenApi
        public void markMappedElement​(java.lang.Object element)
        Marks that element is mapped. Mapped element - element is not created, but used in UML2 model.
        Specified by:
        markMappedElement in interface BaseEmfUml2Helper
        Parameters:
        element -
      • isMappedElement

        @OpenApi
        public boolean isMappedElement​(java.lang.Object element)
        Checks if given element is mapped.
        Specified by:
        isMappedElement in interface BaseEmfUml2Helper
        Parameters:
        element -
        Returns:
        true - if mapped.
      • markSkippedElement

        @OpenApi
        public void markSkippedElement​(java.lang.Object element)
        Mark skipped element.
        Specified by:
        markSkippedElement in interface BaseEmfUml2Helper
        Parameters:
        element -
      • isRemovableElement

        @OpenApi
        public boolean isRemovableElement​(java.lang.Object element)
        Checks if element will be removed or already disposed. Element can be disposed if during export/import differs composite reference multiplicity (* to 1)
        Specified by:
        isRemovableElement in interface BaseEmfUml2Helper
        Parameters:
        element -
        Returns:
        true - if will element should be removed or are alredy removed.
      • markRemovableElement

        public void markRemovableElement​(java.lang.Object element)
        Mark element that will be removed or already disposed
        Specified by:
        markRemovableElement in interface BaseEmfUml2Helper
        Parameters:
        element -
      • isSkippedElement

        @OpenApi
        public boolean isSkippedElement​(java.lang.Object element)
        Checks if given element is skipped.
        Specified by:
        isSkippedElement in interface BaseEmfUml2Helper
        Parameters:
        element -
      • getPersistenceHelper

        public com.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2PersistenceHelper getPersistenceHelper()
        Specified by:
        getPersistenceHelper in interface BaseEmfUml2Helper
      • addCreatedElementIDData

        public void addCreatedElementIDData​(java.lang.Object createdElement,
                                            java.lang.Object relatedElement,
                                            java.lang.String extra)
        Specified by:
        addCreatedElementIDData in interface BaseEmfUml2Helper
      • getElementName

        @OpenApi
        public static java.lang.String getElementName​(Element mdElement,
                                                      boolean qualifiedName)
        Returns element human name.
        Parameters:
        mdElement -
        qualifiedName -
        Returns:
        element type + [qualified] name
      • initProgressStatus

        public static void initProgressStatus​(ProgressStatus progress,
                                              java.lang.String description,
                                              boolean indeterminate)
      • removeElement

        public static void removeElement​(Element element,
                                         java.util.Collection collection)
      • setMDElementID

        public void setMDElementID​(BaseElement mdElement,
                                   java.lang.Object eElement)
        Set MD element id according given EMF element id. If there is id's conflict id is not changed.
        Specified by:
        setMDElementID in interface BaseEmfUml2Helper
        Parameters:
        mdElement - MD element
        eElement - EMF element
      • setMDElementID

        private boolean setMDElementID​(BaseElement mdElement,
                                       java.lang.Object eElement,
                                       java.lang.String id)
        Set element id. If there is element in the project with given id - does nothing
      • constructID

        private java.lang.String constructID​(java.lang.String base,
                                             java.lang.Object eElement)
        Constructs id of given base and given EMF element type and qualified name
        Parameters:
        base -
        eElement -
      • normalize

        private static java.lang.String normalize​(java.lang.String id)
        Normalizes string to be used as part of XML id
      • getUml2MetaModel

        public abstract java.lang.Object getUml2MetaModel()