public final class EAResourceUMLUtils extends EAResourceUtils
EAResourceUtils.AddElementsRunnable
Constructor and Description |
---|
EAResourceUMLUtils() |
Modifier and Type | Method and Description |
---|---|
static EAResourceUMLExporter.DanglingReferences |
checkForDanglingReferences(EObject input)
Check the given model elements for dangling references (reference targets are not contained in a resource), for
referenced EA-specific primitive library types, and used EA-specific XML-based profiles.
|
static UMLResource |
exportEapToUmlResource(EAResource eaResource,
URI umlResourceUri,
org.eclipse.core.runtime.IProgressMonitor monitor)
This call exports an EA model into a
UML model ; make sure to save it afterwards because it is
not yet saved! |
static UMLResource |
exportEapToUmlResource(EAResource eaResource,
URI umlResourceUri,
org.eclipse.core.runtime.IProgressMonitor monitor,
Copier copier)
This call exports an EA model into a
UML model ; make sure to save it afterwards because it is
not yet saved! |
static UMLResource |
exportEapToUmlResource(URI eaResourceUri,
URI umlResourceUri,
org.eclipse.core.runtime.IProgressMonitor monitor)
This call exports an EA model (eap-file) into a
UML model ; make sure to save it afterwards! |
static java.lang.String |
getEACodeEngineeringLanguage(Classifier classifier)
Get EA code engineering language for the given classifier.
|
static Resource |
getEADatatypesResource(EAResource eaResource)
The built-in primitive types of EA models are stored in the
t_datatypes table. |
static java.util.Map<java.lang.String,java.lang.String> |
getEATaggedValues(Element element)
Return an unmodifiable view on all tagged values of the given element that do not belong to any stereotype.
|
static java.lang.String |
getGenFile(Classifier classifier) |
static boolean |
isEASupportedElement(EObject object)
This call checks whether the given EObject is an element that is supported by the YAKIND EA-Bridge UML.
|
static void |
moveUMLContentsToEAResource(Resource sourceResource,
Resource targetResource)
Move all contents from source resource to target resource.
|
static java.lang.String |
moveUMLPackageInEAResource(java.util.Collection<java.lang.Package> sourcePackages,
java.lang.Package targetPackage,
boolean onlyPackageContents)
This moves the contents of all
sourcePackages (not the packages themselves!) |
static java.lang.String |
moveUMLPackageInEAResource(java.lang.Package sourcePackage,
java.lang.Package targetPackage,
boolean onlyPackageContents)
Just like
moveUMLPackageInEAResource(Collection, Package, boolean) but for a single package. |
static java.util.Map<EObject,EObject> |
redirectSourceExternalCrossReferencesToTargetResourceSet(Resource sourceResource,
Resource targetResource)
If the source resource is not located within the target resource set: iterate over all contents of the source
resource and look for cross references to other resources that are not contained in the target resource set.
|
static java.util.Map<EObject,EObject> |
redirectSourceExternalCrossReferencesToTargetResourceSet(Resource sourceResource,
ResourceSet targetResourceSet)
Deprecated.
|
static java.util.Map<java.lang.String,java.lang.Integer> |
repairMissingTypeReferences(EAResource resource,
boolean dryRun)
Type references inside EA models are often stored in two columns, one for the type name, one for its ID.
|
static java.lang.String |
setEACodeEngineeringLanguage(Classifier classifier,
PrimitiveType primitiveType)
Set EA code engineering language for the given classifier to the library to which the given primitive type
belongs.
|
static java.lang.String |
setEACodeEngineeringLanguage(Classifier classifier,
java.lang.String newLanguage)
Set EA code engineering language for the given classifier.
|
static boolean |
setGenFile(Classifier classifier,
java.lang.String newGenFile)
Set GenFile for the given classifier.
|
addElements, addElements, addTaggedValue, createSetting, getEAModelErrors, getElementForGuid, getGuidForElement, getIdForElement, getObjectTypeForElement, isEAConnectedElement, isEaFile, isEaUri, isLocalEaFile, isLocalEaResource, isLocalEaUri, isRemoteEaFile, isRemoteEaResource, isRemoteEaUri, loadEAResourceSilent, loadEAResourceSilent
public static java.util.Map<java.lang.String,java.lang.String> getEATaggedValues(Element element)
element
- Some element loaded via the EAResource
.public static boolean isEASupportedElement(EObject object)
IEAUMLSupportedTypes.SUPPORTED_UML_META_CLASSES
.object
- A model element.public static void moveUMLContentsToEAResource(Resource sourceResource, Resource targetResource)
sourceResource
- targetResource
- public static java.util.Map<EObject,EObject> redirectSourceExternalCrossReferencesToTargetResourceSet(Resource sourceResource, Resource targetResource)
If some cross reference targets could not be replaced, they will be keys with null
-values in the
returning map.
DynamicEObjectImpl
) of
these definitions and the EClass
of an EObject
cannot be changed. So the stereotype
applications will not be redirected!sourceResource
- targetResourceSet
- @Deprecated public static java.util.Map<EObject,EObject> redirectSourceExternalCrossReferencesToTargetResourceSet(Resource sourceResource, ResourceSet targetResourceSet)
redirectSourceExternalCrossReferencesToTargetResourceSet(Resource, Resource)
.public static java.lang.String moveUMLPackageInEAResource(java.util.Collection<java.lang.Package> sourcePackages, java.lang.Package targetPackage, boolean onlyPackageContents)
sourcePackages
(not the packages themselves!) into the contents of
targtPackage
while preserving UML profile applications and, in case the two packages are located in
different resource, stereotype applications. The latter are typically stored in the resource contents list,
however, this is not the case for EAResource
s. So this move-call respects EAResource
s, too.sourcePackages
- The source packages (or their contents) to be moved; must not be null
or empty.targetPackage
- The target package to which the source packages (or their contents) should be moved; must not be
null
.onlyPackageContents
- If true
, the source packages' contents will be moved to the target package; otherwise,
the source packages themselves will be moved to the target package.null
if the move was
successful.public static java.lang.String moveUMLPackageInEAResource(java.lang.Package sourcePackage, java.lang.Package targetPackage, boolean onlyPackageContents)
moveUMLPackageInEAResource(Collection, Package, boolean)
but for a single package.
Note, in case targetPackage
is empty and its name is unset, the name of the
sourcePackage
is set.
sourcePackage
- The source package (or its contents) to be moved.targetPackage
- The target package to which the source package (or its contents) should be moved.onlyPackageContents
- If true
, the source package's contents will be moved to the target package; otherwise,
the source package ifself will be moved to the target package.null
if the move was
successful.public static java.lang.String setEACodeEngineeringLanguage(Classifier classifier, PrimitiveType primitiveType)
IEAUMLConstants
; custom libraries can be contributed via
this extension point
.public static java.lang.String setEACodeEngineeringLanguage(Classifier classifier, java.lang.String newLanguage)
IEAUMLConstants
; custom libraries can be contributed via
this extension point
.public static java.lang.String getEACodeEngineeringLanguage(Classifier classifier)
public static boolean setGenFile(Classifier classifier, java.lang.String newGenFile)
public static java.lang.String getGenFile(Classifier classifier)
public static Resource getEADatatypesResource(EAResource eaResource)
t_datatypes
table. The
EAResource
loads these types in an in-memory resource which can be retrieved with this call.public static java.util.Map<java.lang.String,java.lang.Integer> repairMissingTypeReferences(EAResource resource, boolean dryRun) throws java.lang.RuntimeException
t_attribute
: Type
and Classifier
t_operation
: Type
and Classifier
t_operationparams
: Type
and Classifier
null
(if a unique type
match could not be found).resource
- An EA model that is not opened read-only
.dryRun
- If this is true
, the database will not be changed but all to be fixed and no fixable
references will be reported; if false
, the database will be changed.null
if it could not be fixed.java.lang.RuntimeException
- (with nested SQLException
) in case the database could not be updated.public static UMLResource exportEapToUmlResource(URI eaResourceUri, URI umlResourceUri, org.eclipse.core.runtime.IProgressMonitor monitor) throws java.io.FileNotFoundException
UML model
; make sure to save it afterwards!eaResourceUri
- An existing eap-file.umlResourceUri
- The target uml-file; if will be overwritten if it already exists.monitor
- An optional progress monitor to report EA resource loading.java.io.FileNotFoundException
- If eaResourceUri
cannot be found.public static UMLResource exportEapToUmlResource(EAResource eaResource, URI umlResourceUri, org.eclipse.core.runtime.IProgressMonitor monitor)
UML model
; make sure to save it afterwards because it is
not yet saved!eaResource
- An EA model.umlResourceUri
- The target uml-file; it will be overwritten if it already exists.monitor
- An optional progress monitor to report EA resource loading.public static UMLResource exportEapToUmlResource(EAResource eaResource, URI umlResourceUri, org.eclipse.core.runtime.IProgressMonitor monitor, Copier copier)
UML model
; make sure to save it afterwards because it is
not yet saved!eaResource
- An EA model.umlResourceUri
- The target uml-file; it will be overwritten if it already exists.monitor
- An optional progress monitor to report EA resource loading.copier
- The copier to use, typically new Copier()
; useful if you want to keep track of the
mapping from original to copy element afterwards. Must not be null
, otherwise use
exportEapToUmlResource(EAResource, URI, IProgressMonitor)
.public static EAResourceUMLExporter.DanglingReferences checkForDanglingReferences(EObject input)
Copyright (c) 2015 itemis AG, and others. All rights reserved.