public class EAElementUtil extends AbstractEAUtil
Constructor and Description |
---|
EAElementUtil() |
Modifier and Type | Method and Description |
---|---|
static org.sparx.Constraint |
addConstraint(org.sparx.Element e,
String name,
String type,
String text) |
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.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,
boolean allowDuplicates,
String initialValue,
Multiplicity m,
String type,
Integer classifierID)
Create a new attribute for the given element.
|
static org.sparx.Method |
createEAMethod(org.sparx.Element elmt,
String name) |
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 org.sparx.Method |
getEAMethodWithStereotypeEx(org.sparx.Element e,
String stereotype) |
static SortedMap<String,EATaggedValue> |
getEATaggedValues(org.sparx.Element elmt) |
static void |
loadLinkedDocument(org.sparx.Element e,
String linkedDocumentAbsolutePath) |
static String |
message(int mnr) |
static void |
setEAAbstract(org.sparx.Element e,
boolean isAbstract) |
static void |
setEAAlias(org.sparx.Element e,
String aliasName) |
static void |
setEAGenType(org.sparx.Element e,
String gentype)
Sets attribute GenType on the given EA element.
|
static void |
setEANotes(org.sparx.Element e,
String documentation) |
static void |
setEAStereotypeEx(org.sparx.Element e,
String stereotype)
Sets attribute StereotypeEx on the given EA element.
|
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.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 |
taggedValue(org.sparx.Element elmt,
String tvName)
Retrieves the first tagged value with given name of the given element.
|
static void |
updateTaggedValue(org.sparx.Element e,
String name,
String value,
boolean createAsMemoField)
Updates the tagged values with given name (which can be a fully qualified
name) in the tagged values of the given element.
|
createMessage, createMessage, createMessage, createMessage, stereotypesCSV
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 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.
e
- tvs
- collection of tagged values to setEAException
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 deleteTaggedValue(org.sparx.Element e, String nameOfTVToDelete)
e
- nameOfTVToDelete
- public static void setEAAbstract(org.sparx.Element e, boolean isAbstract) throws EAException
EAException
public static void setEAAlias(org.sparx.Element e, String aliasName) throws EAException
EAException
public static void loadLinkedDocument(org.sparx.Element e, String linkedDocumentAbsolutePath) throws EAException
EAException
public static void setEAGenType(org.sparx.Element e, String gentype) throws EAException
e
- gentype
- EAException
- If updating the element did not succeed, this exception
contains the error message.public static void setEANotes(org.sparx.Element e, String documentation) throws EAException
EAException
public static void setEAStereotypeEx(org.sparx.Element e, String stereotype) throws EAException
e
- stereotype
- EAException
- If updating the element did not succeed, this exception
contains the error message.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 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 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 void updateTaggedValue(org.sparx.Element e, String name, String value, boolean createAsMemoField) throws EAException
e
- the element in which the tagged values shall be updatedname
- (fully qualified or unqualified) name of the tagged value to
update, must not be null
value
- value of the tagged value to update, can be null
createAsMemoField
- If set to true
, the values shall be encoded using
<memo> fields, regardless of the actual length of each
value.EAException
- If updating the element did not succeed, this exception
contains the error message.public static org.sparx.Method createEAMethod(org.sparx.Element elmt, String name) 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, boolean allowDuplicates, String initialValue, Multiplicity m, String type, Integer classifierID) throws EAException
e
- name
- EA attribute name, must not be null
.alias
- EA alias, can be null
.documentation
- EA notes, can be null
.stereotypes
- EA stereotypeEx, can be null
.taggedValues
- Tagged values of the attribute, can be null
.isDerived
- EA isDerived.isOrdered
- EA isOrdered.allowDuplicates
- EA allowDuplicates (the opposite of ShapeChange isUnique)initialValue
- EA default/initialValue, can be null
.m
- Multiplicity of the attribute, can be null
.type
- EA type, can be null
.classifierID
- EA classifierID, can be null
.EAException
- If updating the attribute did not succeed, this exception
contains the error message.public static org.sparx.Connector createEAAssociation(org.sparx.Element client, org.sparx.Element supplier) throws EAException
EAException
public static org.sparx.Method getEAMethodWithStereotypeEx(org.sparx.Element e, String stereotype)
e
- stereotype
- null
if no such method was
foundpublic static SortedMap<String,EATaggedValue> getEATaggedValues(org.sparx.Element elmt)
elmt
- null
public static org.sparx.Constraint addConstraint(org.sparx.Element e, String name, String type, String text) throws EAException
e
- Element to which the new constraint shall be added.name
- Name of the new constrainttype
- Type of the new constrainttext
- Text of the new constraintEAException
public static String message(int mnr)
Copyright © 2018. All rights reserved.