public class EARepositoryUtil extends AbstractEAUtil
Constructor and Description |
---|
EARepositoryUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
closeRepository(org.sparx.Repository rep)
SetEnableUIUpdates=true, RefreshModelView(0), SetEnableCache=false,
SetBatchAppend=false, CloseFile(), Exit();
|
static void |
compact()
Runs Java garbage collector (System.gc()) and then the finalization
(System.runFinalization()).
|
static org.sparx.Element |
createEAClass(org.sparx.Repository rep,
String className,
int eaPkgId) |
static org.sparx.Element |
createEAClass(org.sparx.Repository rep,
String className,
int eaPkgId,
String type) |
static void |
createEAGeneralization(org.sparx.Repository rep,
int c1ElementId,
String c1Name,
int c2ElementId,
String c2Name) |
static int |
createEAPackage(org.sparx.Repository rep,
PackageInfo pi,
int eaParentPkgId)
Creates an EA package for the given PackageInfo.
|
static void |
deletePackage(org.sparx.Repository rep,
int eaPkgId)
Deletes the package with given EA ID.
|
static int |
establishEAPackageHierarchy(ClassInfo ci,
int containerPkgId,
SortedMap<Integer,SortedMap<PackageInfo,Integer>> eaPkgIdByModelPkg_byContainerPkgId,
org.sparx.Repository rep,
int numberOfSchemasSelectedForProcessing)
Creates a package hierarchy inside a given container package.
|
static Integer |
getEAChildPackageByName(org.sparx.Repository rep,
int eaParentPkgId,
String name) |
static Integer |
getEAChildPackageByStereotype(org.sparx.Repository rep,
int eaParentPkgId,
String stereotype)
Identify the child package with given stereotype.
|
static String |
message(int mnr) |
static org.sparx.Repository |
openRepository(File repfileIn,
boolean createIfNotExisting) |
static void |
setEABatchAppend(org.sparx.Repository rep,
boolean batchAppend)
Documentation provided by EA: Set this property to
true
when your automation client has to rapidly insert many elements,
operations, attributes and/or operation parameters. |
static void |
setEAEnableUIUpdates(org.sparx.Repository rep,
boolean enableUIUpdates)
Documentation provided by EA: Set this property to
false
to improve the performance of changes to the model; for example, bulk
addition of elements to a Package. |
createMessage, createMessage, createMessage, createMessage, stereotypesCSV
public static void compact()
public static void setEABatchAppend(org.sparx.Repository rep, boolean batchAppend)
true
when your automation client has to rapidly insert many elements,
operations, attributes and/or operation parameters. Set to
false
when work is complete. This can result in 10- to
20-fold improvement in adding new elements in bulk.rep
- batchAppend
- public static void setEAEnableUIUpdates(org.sparx.Repository rep, boolean enableUIUpdates)
false
to improve the performance of changes to the model; for example, bulk
addition of elements to a Package. To reveal changes to the user, call
'Repository.RefreshModelView()'.rep
- batchAppend
- public static Integer getEAChildPackageByName(org.sparx.Repository rep, int eaParentPkgId, String name)
rep
- the repository to queryeaParentPkgId
- EA ID of the parent packagename
- Name of the child package to look upnull
public static Integer getEAChildPackageByStereotype(org.sparx.Repository rep, int eaParentPkgId, String stereotype)
rep
- the repository to queryeaParentPkgId
- EA ID of the parent packagestereotype
- Stereotype of the child package to look upnull
public static void deletePackage(org.sparx.Repository rep, int eaPkgId)
rep
- the repository to queryeaPkgId
- EA ID of the package to deletepublic static void createEAGeneralization(org.sparx.Repository rep, int c1ElementId, String c1Name, int c2ElementId, String c2Name) throws EAException
EAException
public static void closeRepository(org.sparx.Repository rep)
rep
- public static org.sparx.Repository openRepository(File repfileIn, boolean createIfNotExisting) throws EAException
repfileIn
- createIfNotExisting
- If true
, create the EAP file if it does not exist
yet, including the required directory structure.EAException
public static org.sparx.Element createEAClass(org.sparx.Repository rep, String className, int eaPkgId) throws EAException
EAException
public static org.sparx.Element createEAClass(org.sparx.Repository rep, String className, int eaPkgId, String type) throws EAException
EAException
public static int createEAPackage(org.sparx.Repository rep, PackageInfo pi, int eaParentPkgId) throws EAException
rep
- pi
- package to create in EAeaParentPkgId
- The PackageID of the EA Package element that is the parent of
the EA Package to create for piEAException
- If an EA error was encountered while updating the packagepublic static int establishEAPackageHierarchy(ClassInfo ci, int containerPkgId, SortedMap<Integer,SortedMap<PackageInfo,Integer>> eaPkgIdByModelPkg_byContainerPkgId, org.sparx.Repository rep, int numberOfSchemasSelectedForProcessing) throws EAException
ci
- The class for which to establish its package hierarchy.containerPkgId
- PackageID of the EA package in the EA repository (see
parameter 'rep') in which the package hierarchy shall be
established.eaPkgIdByModelPkg_byContainerPkgId
- Map of maps to store and look up the PackageIDs of EA packages
that are established. key: PackageID of the container package;
value: {map with key: a package; value: corresponding EA
package within the container package}rep
- The EA repository that contains the container package.numberOfSchemasSelectedForProcessing
- EAException
- If an exception occurred while interacting with the EA
repository.public static String message(int mnr)
Copyright © 2018. All rights reserved.