public class EAModelUtil extends Object
Constructor and Description |
---|
EAModelUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
addTaggedValue(org.sparx.Attribute att,
EATaggedValue tv)
Adds the given collection of tagged values to the tagged values of the
given attribute, NOT checking for duplicate tags.
|
static void |
addTaggedValue(org.sparx.ConnectorEnd end,
EATaggedValue tv)
Adds the given tagged value to the given connector end, NOT checking for
duplicate tags.
|
static void |
addTaggedValue(org.sparx.Element e,
EATaggedValue tv)
Adds the given tagged value to the tagged values of the given element,
NOT checking for duplicate tags.
|
static void |
addTaggedValues(org.sparx.Attribute att,
List<EATaggedValue> tvs)
Adds the given collection of tagged values to the tagged values of the
given attribute, NOT checking for duplicate tags.
|
static void |
addTaggedValues(org.sparx.Attribute att,
TaggedValues tvs)
Adds the given collection of tagged values to the tagged values of the
given attribute, NOT checking for duplicate tags.
|
static void |
addTaggedValues(org.sparx.ConnectorEnd end,
TaggedValues tvs)
Adds the given collection of tagged values to the given connector end,
NOT checking for duplicate tags.
|
static void |
addTaggedValues(org.sparx.Connector con,
List<EATaggedValue> tvs)
Adds the given collection of tagged values to the given connector, NOT
checking for duplicate tags.
|
static void |
addTaggedValues(org.sparx.Connector con,
TaggedValues tvs)
Adds the given collection of tagged values to the given connector, NOT
checking for duplicate tags.
|
static void |
addTaggedValues(org.sparx.Element e,
List<EATaggedValue> tvs)
Adds the given list of tagged values to the collection of (EA) tagged
values of the given element, NOT checking for duplicate tags.
|
static void |
addTaggedValues(org.sparx.Element e,
TaggedValues tvs)
Adds the given collection of tagged values to the tagged values of the
given element, NOT checking for duplicate tags.
|
static org.sparx.Connector |
createEAAssociation(org.sparx.Element client,
org.sparx.Element supplier) |
static org.sparx.Attribute |
createEAAttribute(org.sparx.Element e,
String name,
String alias,
String documentation,
Set<String> stereotypes,
List<EATaggedValue> taggedValues,
boolean isDerived,
boolean isOrdered,
String initialValue,
Multiplicity m,
String type,
Integer classifierID) |
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 String |
createMessage(int mnr) |
static String |
createMessage(int mnr,
String p1) |
static String |
createMessage(int mnr,
String p1,
String p2) |
static String |
createMessage(int mnr,
String p1,
String p2,
String p3) |
static String |
createMessage(int mnr,
String p1,
String p2,
String p3,
String p4) |
static void |
deleteTaggedValue(org.sparx.Attribute a,
String nameOfTVToDelete) |
static void |
deleteTaggedValue(org.sparx.ConnectorEnd ce,
String nameOfTVToDelete) |
static void |
deleteTaggedValue(org.sparx.Connector con,
String nameOfTVToDelete) |
static void |
deleteTaggedValue(org.sparx.Element e,
String nameOfTVToDelete)
Deletes all tagged values whose name equals (ignoring case) the given
name in the given element.
|
static Integer |
getEAChildPackageByName(org.sparx.Repository rep,
int eaParentPkgId,
String name) |
static String |
message(int mnr) |
static void |
setEAAbstract(boolean isAbstract,
org.sparx.Element e) |
static void |
setEAAlias(String aliasName,
org.sparx.Element e) |
static void |
setEAAssociationClass(org.sparx.Connector con,
org.sparx.Element classElement)
NOTE: only works with EA 12 Java API, not the previous API.
|
static void |
setEACardinality(org.sparx.ConnectorEnd conEnd,
String cardinalityAsString) |
static void |
setEAName(org.sparx.Connector con,
String name) |
static void |
setEANotes(String documentation,
org.sparx.Element e) |
static void |
setEARole(org.sparx.ConnectorEnd conEnd,
String role) |
static void |
setEAStereotype(org.sparx.Connector con,
String stereotype) |
static void |
setEAStereotype(org.sparx.Element e,
String stereotype) |
static void |
setTaggedValue(org.sparx.Attribute att,
EATaggedValue tv)
Sets the given tagged value in the tagged values of the given attribute.
|
static void |
setTaggedValue(org.sparx.Attribute att,
String name,
String value)
Sets the given tagged value in the tagged values of the given attribute.
|
static void |
setTaggedValue(org.sparx.ConnectorEnd ce,
EATaggedValue tv)
Sets the given tagged value in the given connector end.
|
static void |
setTaggedValue(org.sparx.ConnectorEnd end,
String name,
String value)
Sets the given tagged value in the tagged values of the given connector
end.
|
static void |
setTaggedValue(org.sparx.Element e,
EATaggedValue tv)
Sets the given tagged value in the tagged values of the given element.
|
static void |
setTaggedValue(org.sparx.Element e,
String name,
String value)
Sets the given tagged value in the tagged values of the given element.
|
static void |
setTaggedValues(org.sparx.Attribute att,
List<EATaggedValue> tvs)
Sets the given tagged values in the given attribute.
|
static void |
setTaggedValues(org.sparx.Attribute att,
TaggedValues tvs)
Sets the given tagged values in the given attribute.
|
static void |
setTaggedValues(org.sparx.ConnectorEnd ce,
TaggedValues tvs)
Sets the given tagged values in the given connector end.
|
static void |
setTaggedValues(org.sparx.Connector con,
List<EATaggedValue> tvs)
Sets the given tagged values in the given connector.
|
static void |
setTaggedValues(org.sparx.Connector con,
TaggedValues tvs)
Sets the given tagged values in the given connector.
|
static void |
setTaggedValues(org.sparx.Element e,
List<EATaggedValue> tvs)
Sets the given tagged values in the given element.
|
static void |
setTaggedValues(org.sparx.Element e,
TaggedValues tvs)
Sets the given tagged values in the given element.
|
static String |
stereotypesCSV(Set<String> stereotypes) |
static String |
taggedValue(org.sparx.Attribute att,
String tvName)
Retrieves the first tagged value with given name of the given attribute.
|
static String |
taggedValue(org.sparx.ConnectorEnd end,
String tvName)
Retrieves the first tagged value with given name of the given attribute.
|
static String |
taggedValue(org.sparx.Element elmt,
String tvName)
Retrieves the first tagged value with given name of the given element.
|
public static int createEAPackage(org.sparx.Repository rep, PackageInfo pi, int eaParentPkgId) throws EAException
pi
- package to create in EAeaParentPkg
- 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 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 void setEAAlias(String aliasName, org.sparx.Element e) throws EAException
EAException
public static void setEANotes(String documentation, org.sparx.Element e) throws EAException
EAException
public static void setEAStereotype(org.sparx.Element e, String stereotype) throws EAException
EAException
public static String stereotypesCSV(Set<String> stereotypes)
stereotypes
- public static String taggedValue(org.sparx.Element elmt, String tvName)
elmt
- element that contains the tagged values to searchtvName
- name of the tagged value to retrievenull
if the tagged value was not found. If there are multiple values
with the tag only the first is provided.public static String taggedValue(org.sparx.Attribute att, String tvName)
att
- attribute that contains the tagged values to searchtvName
- name of the tagged value to retrievenull
if the tagged value was not found. If there are multiple values
with the tag only the first is provided.public static String taggedValue(org.sparx.ConnectorEnd end, String tvName)
att
- attribute that contains the tagged values to searchtvName
- name of the tagged value to retrievenull
if the tagged value was not found. If there are multiple values
with the tag only the first is provided.public static String createMessage(int mnr, String p1, String p2, String p3, String p4)
public static String createMessage(int mnr)
public static String message(int mnr)
public static Integer getEAChildPackageByName(org.sparx.Repository rep, int eaParentPkgId, String name)
public static void setEAAbstract(boolean isAbstract, org.sparx.Element e) throws EAException
EAException
public static org.sparx.Attribute createEAAttribute(org.sparx.Element e, String name, String alias, String documentation, Set<String> stereotypes, List<EATaggedValue> taggedValues, boolean isDerived, boolean isOrdered, String initialValue, Multiplicity m, String type, Integer classifierID) throws EAException
EAException
public static void addTaggedValue(org.sparx.Attribute att, EATaggedValue tv) throws EAException
WARNING: Enterprise Architect may initialize default tagged values for a model element that adheres to a specific UML profile. In that case, adding the same tagged values would lead to duplicates. If duplicates shall be prevented, set the tagged value instead of adding it.
att
- the attribute to which the tagged values shall be addedtvs
- collection of tagged values to addEAException
public static void addTaggedValues(org.sparx.Attribute att, TaggedValues tvs) throws EAException
WARNING: Enterprise Architect may initialize default tagged values for a model element that adheres to a specific UML profile. In that case, adding the same tagged values would lead to duplicates. If duplicates shall be prevented, set the tagged value instead of adding it.
att
- the attribute to which the tagged values shall be addedtvs
- collection of tagged values to addEAException
public static void addTaggedValues(org.sparx.Element e, TaggedValues tvs) throws EAException
WARNING: Enterprise Architect may initialize default tagged values for a model element that adheres to a specific UML profile. In that case, adding the same tagged values would lead to duplicates. If duplicates shall be prevented, set the tagged value instead of adding it.
e
- the element to which the tagged values shall be addedtvs
- collection of tagged values to addEAException
public static void setTaggedValue(org.sparx.Attribute att, EATaggedValue tv) throws EAException
att
- the attribute in which the tagged value shall be settv
- tagged value to set, must not be null
EAException
public static void setTaggedValue(org.sparx.Attribute att, String name, String value) throws EAException
att
- the attribute in which the tagged value shall be setname
- name of the tagged value to set, must not be null
value
- value of the tagged value to set, can be null
EAException
public static void setTaggedValue(org.sparx.ConnectorEnd end, String name, String value) throws EAException
end
- the connector end in which the tagged value shall be setname
- name of the tagged value to set, must not be null
value
- value of the tagged value to set, can be null
EAException
public static void setTaggedValues(org.sparx.Element e, List<EATaggedValue> tvs) throws EAException
e
- the element in which the tagged values shall be settvs
- tagged values to set, must not be null
EAException
public static void setTaggedValues(org.sparx.Element e, TaggedValues tvs) throws EAException
e
- the element in which the tagged values shall be settvs
- tagged values to set, must not be null
EAException
public static void addTaggedValue(org.sparx.Element e, EATaggedValue tv) throws EAException
WARNING: Enterprise Architect may initialize default tagged values for a model element that adheres to a specific UML profile. In that case, adding the same tagged values would lead to duplicates. If duplicates shall be prevented, set the tagged value instead of adding it.
e
- the element to which the tagged value shall be addedtv
- tagged value to addEAException
public static void deleteTaggedValue(org.sparx.Element e, String nameOfTVToDelete)
e
- nameOfTVToDelete
- public static void deleteTaggedValue(org.sparx.Attribute a, String nameOfTVToDelete)
public static void deleteTaggedValue(org.sparx.Connector con, String nameOfTVToDelete)
public static void deleteTaggedValue(org.sparx.ConnectorEnd ce, String nameOfTVToDelete)
public static void setTaggedValue(org.sparx.Element e, EATaggedValue tv) throws EAException
e
- the element in which the tagged value shall be settv
- tagged value to set, must not be null
EAException
public static void setTaggedValue(org.sparx.Element e, String name, String value) throws EAException
e
- the element in which the tagged value shall be setname
- name of the tagged value to set, must not be null
value
- value of the tagged value to set, can be null
EAException
public static void addTaggedValues(org.sparx.Element e, List<EATaggedValue> tvs) throws EAException
WARNING: Enterprise Architect may initialize default tagged values for a model element that adheres to a specific UML profile. In that case, adding the same tagged values would lead to duplicates. If duplicates shall be prevented, set the tagged value instead of adding it.
cTV
- the collection of existing tagged valuestvs
- collection of tagged values to setEAException
public static void addTaggedValues(org.sparx.Attribute att, List<EATaggedValue> tvs) throws EAException
WARNING: Enterprise Architect may initialize default tagged values for a model element that adheres to a specific UML profile. In that case, adding the same tagged values would lead to duplicates. If duplicates shall be prevented, set the tagged value instead of adding it.
att
- the attribute to which the tagged values shall be addedtvs
- collection of tagged values to addEAException
public static void setTaggedValues(org.sparx.Attribute att, List<EATaggedValue> tvs) throws EAException
att
- the attribute in which the tagged values shall be settvs
- tagged values to set, must not be null
EAException
public static void setTaggedValues(org.sparx.Attribute att, TaggedValues tvs) throws EAException
att
- the attribute in which the tagged values shall be settvs
- tagged values to set, must not be null
EAException
public static void createEAGeneralization(org.sparx.Repository rep, int c1ElementId, String c1Name, int c2ElementId, String c2Name) throws EAException
EAException
public static org.sparx.Connector createEAAssociation(org.sparx.Element client, org.sparx.Element supplier) throws EAException
EAException
public static void setEARole(org.sparx.ConnectorEnd conEnd, String role) throws EAException
EAException
public static void setEACardinality(org.sparx.ConnectorEnd conEnd, String cardinalityAsString) throws EAException
EAException
public static void setEAName(org.sparx.Connector con, String name) throws EAException
EAException
public static void setEAStereotype(org.sparx.Connector con, String stereotype) throws EAException
EAException
public static void addTaggedValues(org.sparx.Connector con, List<EATaggedValue> tvs) throws EAException
WARNING: Enterprise Architect may initialize default tagged values for a model element that adheres to a specific UML profile. In that case, adding the same tagged values would lead to duplicates. If duplicates shall be prevented, set the tagged value instead of adding it.
con
- the connector to which the tagged values shall be addedtvs
- collection of tagged values to addEAException
public static void setTaggedValues(org.sparx.Connector con, List<EATaggedValue> tvs) throws EAException
con
- the connector in which the tagged values shall be settvs
- tagged values to set, must not be null
EAException
public static void addTaggedValues(org.sparx.Connector con, TaggedValues tvs) throws EAException
WARNING: Enterprise Architect may initialize default tagged values for a model element that adheres to a specific UML profile. In that case, adding the same tagged values would lead to duplicates. If duplicates shall be prevented, set the tagged value instead of adding it.
con
- the connector to which the tagged values shall be addedtvs
- collection of tagged values to addEAException
public static void setTaggedValues(org.sparx.Connector con, TaggedValues tvs) throws EAException
con
- the connector in which the tagged values shall be settvs
- tagged values to set, must not be null
EAException
public static void addTaggedValues(org.sparx.ConnectorEnd end, TaggedValues tvs) throws EAException
WARNING: Enterprise Architect may initialize default tagged values for a model element that adheres to a specific UML profile. In that case, adding the same tagged values would lead to duplicates. If duplicates shall be prevented, set the tagged value instead of adding it.
e
- the connector end to which the tagged values shall be addedtvs
- collection of tagged values to addEAException
public static void addTaggedValue(org.sparx.ConnectorEnd end, EATaggedValue tv) throws EAException
WARNING: Enterprise Architect may initialize default tagged values for a model element that adheres to a specific UML profile. In that case, adding the same tagged values would lead to duplicates. If duplicates shall be prevented, set the tagged value instead of adding it.
end
- the connector end to which the tagged value shall be addedtv
- tagged value to add, must not be null
EAException
public static void setTaggedValues(org.sparx.ConnectorEnd ce, TaggedValues tvs) throws EAException
ce
- the connector end in which the tagged values shall be settvs
- tagged values to set, must not be null
EAException
public static void setTaggedValue(org.sparx.ConnectorEnd ce, EATaggedValue tv) throws EAException
ce
- the connector end in which the tagged value shall be settv
- tagged value to set, must not be null
EAException
public static void setEAAssociationClass(org.sparx.Connector con, org.sparx.Element classElement) throws EAException
con
- classElement
- EAException
Copyright © 2017. All rights reserved.