Package com.nomagic.magicdraw.emfuml2xmi
Class BaseEmfUml2Helper
- java.lang.Object
-
- com.nomagic.magicdraw.emfuml2xmi.BaseEmfUml2Helper
-
- All Implemented Interfaces:
BaseEElementNameRetriever
,BaseEmfUml2Helper
- Direct Known Subclasses:
EmfUml2Helper
@OpenApi public abstract class BaseEmfUml2Helper extends java.lang.Object implements BaseEmfUml2Helper
Eclipse UML2 XMI helper.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
MAGICDRAW_SOURCE
private java.util.Set<java.lang.String>
mChangedIDs
Set of changed original idsprivate java.util.Map<java.lang.Object,com.nomagic.magicdraw.emfuml2xmi.export.CreatedElementData>
mCreatedElementsIDData
static java.lang.String
MD_ID
static java.lang.String
MD_PROPERTY_NAME
private BaseEElementNameRetriever
mEElementNameRetriever
private BaseEmfOptionsGroup
mEmfOptionsGroup
private java.util.List<FinalizeActivity>
mFinalizeActivities
private com.nomagic.magicdraw.emfuml2xmi.export.BaseEmfUml2IDManager
mIDManager
private EmfUml2Logger
mLogger
private java.util.Set<java.lang.Object>
mMappedElements
private static java.util.List<java.lang.String>
mMDStandardProfiles
private com.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2PersistenceHelper
mPersistenceHelper
private Project
mProject
private java.util.Set<java.lang.Object>
mRemovableElements
private java.util.Map<java.lang.String,java.lang.Object>
mSetIDs
Map of changed ids: id --> eElement ID IS CHANGED FOR MAGICDRAW ELEMENTprivate java.util.Set<java.lang.Object>
mSkippedElements
private com.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2DataTypeMap
mUml2DataTypeMap
-
Constructor Summary
Constructors Constructor Description BaseEmfUml2Helper(Project project, com.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2PersistenceHelper persistenceHelper, com.nomagic.magicdraw.emfuml2xmi.export.BaseEmfUml2IDManager idManager, BaseEmfOptionsGroup emfOptionsGroup, EmfUml2Logger logger)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addCreatedElementIDData(java.lang.Object createdElement, java.lang.Object relatedElement, java.lang.String extra)
void
addFinalizeActivity(FinalizeActivity activity)
void
clearCreatedElementsIDData()
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 nameprotected abstract com.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2DataTypeMap
createDataTypeMap()
protected abstract BaseEElementNameRetriever
createEElementNameRetriever()
java.util.Map
getCreatedElementsIDData()
java.lang.String
getEElementName(java.lang.Object eElement)
Returns element human name.static java.lang.String
getElementName(Element mdElement, boolean qualifiedName)
Returns element human name.BaseEmfOptionsGroup
getEmfOptionsGroup()
Deprecated.java.util.List<FinalizeActivity>
getFinalizeActivities()
EmfUml2Logger
getLogger()
Returns logger.abstract java.util.Map
getMagicDrawAnnotationDetails(java.lang.Object eElement, boolean create)
java.util.List<java.lang.String>
getMDProjectBuiltinProfiles()
Returns profiles that are "built-in" in MagicDraw projectstatic java.util.List
getMDStandardProfiles()
BaseOptions
getOptions()
com.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2PersistenceHelper
getPersistenceHelper()
Project
getProject()
Returns current projectcom.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2DataTypeMap
getUml2DataTypeMap()
Returns datatype mapabstract java.lang.Object
getUml2MetaModel()
static void
initProgressStatus(ProgressStatus progress, java.lang.String description, boolean indeterminate)
boolean
isMappedElement(java.lang.Object element)
Checks if given element is mapped.boolean
isRemovableElement(java.lang.Object element)
Checks if element will be removed or already disposed.boolean
isSkippedElement(java.lang.Object element)
Checks if given element is skipped.void
markMappedElement(java.lang.Object element)
Marks that element is mapped.void
markRemovableElement(java.lang.Object element)
Mark element that will be removed or already disposedvoid
markSkippedElement(java.lang.Object element)
Mark skipped element.private static java.lang.String
normalize(java.lang.String id)
Normalizes string to be used as part of XML idstatic void
removeElement(Element element, java.util.Collection collection)
void
setMDElementID(BaseElement mdElement, java.lang.Object eElement)
Set MD element id according given EMF element id.private boolean
setMDElementID(BaseElement mdElement, java.lang.Object eElement, java.lang.String id)
Set element id.
-
-
-
Field Detail
-
MAGICDRAW_SOURCE
protected static final java.lang.String MAGICDRAW_SOURCE
- See Also:
- Constant Field Values
-
MD_ID
public static final java.lang.String MD_ID
- 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
-
mLogger
private final EmfUml2Logger mLogger
-
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
-
mEElementNameRetriever
private final BaseEElementNameRetriever mEElementNameRetriever
-
mEmfOptionsGroup
private final BaseEmfOptionsGroup mEmfOptionsGroup
-
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 interfaceBaseEmfUml2Helper
- Returns:
- datatypes map
-
createDataTypeMap
protected abstract com.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2DataTypeMap createDataTypeMap()
-
createEElementNameRetriever
protected abstract BaseEElementNameRetriever createEElementNameRetriever()
-
getMagicDrawAnnotationDetails
public abstract java.util.Map getMagicDrawAnnotationDetails(java.lang.Object eElement, boolean create)
- Specified by:
getMagicDrawAnnotationDetails
in interfaceBaseEmfUml2Helper
-
getProject
@OpenApi public Project getProject()
Returns current project- Specified by:
getProject
in interfaceBaseEmfUml2Helper
- Returns:
- project
-
getMDStandardProfiles
public static java.util.List getMDStandardProfiles()
-
getMDProjectBuiltinProfiles
public java.util.List<java.lang.String> getMDProjectBuiltinProfiles()
Description copied from interface:BaseEmfUml2Helper
Returns profiles that are "built-in" in MagicDraw project- Specified by:
getMDProjectBuiltinProfiles
in interfaceBaseEmfUml2Helper
- Returns:
-
getLogger
@OpenApi public EmfUml2Logger getLogger()
Returns logger.- Specified by:
getLogger
in interfaceBaseEmfUml2Helper
- Returns:
- logger
-
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 interfaceBaseEmfUml2Helper
- Parameters:
element
-
-
isMappedElement
@OpenApi public boolean isMappedElement(java.lang.Object element)
Checks if given element is mapped.- Specified by:
isMappedElement
in interfaceBaseEmfUml2Helper
- Parameters:
element
-- Returns:
- true - if mapped.
-
markSkippedElement
@OpenApi public void markSkippedElement(java.lang.Object element)
Mark skipped element.- Specified by:
markSkippedElement
in interfaceBaseEmfUml2Helper
- 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 interfaceBaseEmfUml2Helper
- 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 interfaceBaseEmfUml2Helper
- Parameters:
element
-
-
getFinalizeActivities
public java.util.List<FinalizeActivity> getFinalizeActivities()
- Specified by:
getFinalizeActivities
in interfaceBaseEmfUml2Helper
-
isSkippedElement
@OpenApi public boolean isSkippedElement(java.lang.Object element)
Checks if given element is skipped.- Specified by:
isSkippedElement
in interfaceBaseEmfUml2Helper
- Parameters:
element
-
-
getPersistenceHelper
public com.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2PersistenceHelper getPersistenceHelper()
- Specified by:
getPersistenceHelper
in interfaceBaseEmfUml2Helper
-
addCreatedElementIDData
public void addCreatedElementIDData(java.lang.Object createdElement, java.lang.Object relatedElement, java.lang.String extra)
- Specified by:
addCreatedElementIDData
in interfaceBaseEmfUml2Helper
-
getCreatedElementsIDData
public java.util.Map getCreatedElementsIDData()
- Specified by:
getCreatedElementsIDData
in interfaceBaseEmfUml2Helper
-
clearCreatedElementsIDData
public void clearCreatedElementsIDData()
- Specified by:
clearCreatedElementsIDData
in interfaceBaseEmfUml2Helper
-
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 interfaceBaseEmfUml2Helper
- Parameters:
mdElement
- MD elementeElement
- 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
-
getEmfOptionsGroup
@Deprecated public BaseEmfOptionsGroup getEmfOptionsGroup()
Deprecated.- Returns:
-
getOptions
public BaseOptions getOptions()
- Specified by:
getOptions
in interfaceBaseEmfUml2Helper
-
getEElementName
@OpenApi public final java.lang.String getEElementName(java.lang.Object eElement)
Returns element human name.- Specified by:
getEElementName
in interfaceBaseEElementNameRetriever
- Specified by:
getEElementName
in interfaceBaseEmfUml2Helper
- Parameters:
eElement
-- Returns:
- element type + qualified name
-
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
-
addFinalizeActivity
public void addFinalizeActivity(FinalizeActivity activity)
- Specified by:
addFinalizeActivity
in interfaceBaseEmfUml2Helper
-
getUml2MetaModel
public abstract java.lang.Object getUml2MetaModel()
-
-