本文整理汇总了Java中org.eclipse.uml2.uml.Property.setName方法的典型用法代码示例。如果您正苦于以下问题:Java Property.setName方法的具体用法?Java Property.setName怎么用?Java Property.setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.uml2.uml.Property
的用法示例。
在下文中一共展示了Property.setName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setAssociationForStructuredClassifier
import org.eclipse.uml2.uml.Property; //导入方法依赖的package包/类
/**
* Association설정
*
* @param relationType
* @param umlModel
* @param supplier
* @param isNevigableSupplier
* @param client
* @param isNevigableClient
* void
*/
public static void setAssociationForStructuredClassifier(Association umlModel, NamedElement supplier,
boolean isNevigableSupplier,
AggregationKind aggregationKindSupplier,
NamedElement client, boolean isNevigableClient,
AggregationKind aggregationKindClient) {
Property supplierProperty = UMLHelper.createProperty();
Property clientProperty = UMLHelper.createProperty();
supplierProperty.setType((Type) client);
clientProperty.setType((Type) supplier);
clientProperty.setName(supplier.getName().toLowerCase());
supplierProperty.setName(client.getName().toLowerCase());
supplierProperty.setAggregation(aggregationKindSupplier);
clientProperty.setAggregation(aggregationKindClient);
supplierProperty.setAssociation(umlModel);
clientProperty.setAssociation(umlModel);
if (isNevigableSupplier) {
setProperty(supplier, supplierProperty);
} else {
umlModel.getOwnedEnds().add(supplierProperty);
}
if (isNevigableClient) {
setProperty(client, clientProperty);
} else {
umlModel.getOwnedEnds().add(clientProperty);
}
org.eclipse.uml2.uml.Package packageElement = client.getNearestPackage();
if (client instanceof Component) {
((Component) client).getPackagedElements().add(umlModel);
} else {
packageElement.getPackagedElements().add(umlModel);
}
}
示例2: createAttribute
import org.eclipse.uml2.uml.Property; //导入方法依赖的package包/类
/**
* 하나의 속성을 생성함.
*/
private void createAttribute() {
uniqueName = (UMLManager.getPackagedUniqueName(this.getData(), UMLMessage.getMessage(UMLMessage.UML_PROPERTY)));
Property property = UMLHelper.createProperty();
property.setName(uniqueName);
if (getData() instanceof StructuredClassifier) {
((StructuredClassifier) getData()).getOwnedAttributes().add(property);
} else if (getData() instanceof Interface) {
((Interface) getData()).getOwnedAttributes().add(property);
} else if (getData() instanceof DataType) {
((DataType) getData()).getOwnedAttributes().add(property);
} else if (getData() instanceof Signal) {
((Signal) getData()).getOwnedAttributes().add(property);
}
}