本文整理汇总了Java中org.eclipse.uml2.uml.AggregationKind类的典型用法代码示例。如果您正苦于以下问题:Java AggregationKind类的具体用法?Java AggregationKind怎么用?Java AggregationKind使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AggregationKind类属于org.eclipse.uml2.uml包,在下文中一共展示了AggregationKind类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createAssociation
import org.eclipse.uml2.uml.AggregationKind; //导入依赖的package包/类
/**
* 클래스간 관계 생성
*
* @param type1
* @param end1IsNavigable
* @param end1Aggregation
* @param end1Name
* @param end1LowerBound
* @param end1UpperBound
* @param type2
* @param end2IsNavigable
* @param end2Aggregation
* @param end2Name
* @param end2LowerBound
* @param end2UpperBound
* @return Association
*/
public static Association createAssociation(Type type1, boolean end1IsNavigable, AggregationKind end1Aggregation,
String end1Name, int end1LowerBound, int end1UpperBound, Type type2,
boolean end2IsNavigable, AggregationKind end2Aggregation,
String end2Name, int end2LowerBound, int end2UpperBound) {
Association association = type1.createAssociation(end1IsNavigable,
end1Aggregation,
end1Name,
end1LowerBound,
end1UpperBound,
type2,
end2IsNavigable,
end2Aggregation,
end2Name,
end2LowerBound,
end2UpperBound);
return association;
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:36,代码来源:ClassDiagramUtil.java
示例2: testSimpleAggregation
import org.eclipse.uml2.uml.AggregationKind; //导入依赖的package包/类
public void testSimpleAggregation() throws CoreException {
String source = "";
source += "model simple;\n";
source += "aggregation AccountClient\n";
source += " navigable role account : Account[*];\n";
source += " navigable role client : Client[1];\n";
source += "end;\n";
source += "end.";
parseAndCheck(getSimpleModelSource(), source);
final Association association = (Association) getRepository().findNamedElement("simple::AccountClient",
IRepository.PACKAGE.getAssociation(), null);
assertNotNull(association);
Property accountEnd = association.getOwnedEnd("account", null);
assertNotNull(accountEnd);
assertEquals(AggregationKind.SHARED_LITERAL, accountEnd.getAggregation());
Property clientEnd = association.getOwnedEnd("client", null);
assertNotNull(clientEnd);
assertEquals(AggregationKind.NONE_LITERAL, clientEnd.getAggregation());
}
开发者ID:abstratt,项目名称:textuml,代码行数:20,代码来源:AssociationTests.java
示例3: testSimpleComposition
import org.eclipse.uml2.uml.AggregationKind; //导入依赖的package包/类
public void testSimpleComposition() throws CoreException {
String source = "";
source += "model simple;\n";
source += "composition AccountClient\n";
source += " navigable role account : Account[*];\n";
source += " navigable role client : Client[1];\n";
source += "end;\n";
source += "end.";
parseAndCheck(getSimpleModelSource(), source);
final Association association = getRepository().findNamedElement("simple::AccountClient",
IRepository.PACKAGE.getAssociation(), null);
assertNotNull(association);
Property accountEnd = association.getOwnedEnd("account", null);
assertNotNull(accountEnd);
assertEquals(AggregationKind.COMPOSITE_LITERAL, accountEnd.getAggregation());
Property clientEnd = association.getOwnedEnd("client", null);
assertNotNull(clientEnd);
assertEquals(AggregationKind.NONE_LITERAL, clientEnd.getAggregation());
}
开发者ID:abstratt,项目名称:textuml,代码行数:20,代码来源:AssociationTests.java
示例4: setAssociationForStructuredClassifier
import org.eclipse.uml2.uml.AggregationKind; //导入依赖的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);
}
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:50,代码来源:UMLManager.java
示例5: setAggregationForStructuredClassifier
import org.eclipse.uml2.uml.AggregationKind; //导入依赖的package包/类
/**
* Aggregation설정
*
* @param relationType
* @param umlModel
* @param supplier
* @param isNevigableSupplier
* @param client
* @param isNevigableClient
* void
*/
public static void setAggregationForStructuredClassifier(Association umlModel, NamedElement supplier,
NamedElement client) {
setAssociationForStructuredClassifier(umlModel,
supplier,
true,
AggregationKind.NONE_LITERAL,
client,
true,
AggregationKind.SHARED_LITERAL);
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:23,代码来源:UMLManager.java
示例6: setDirectedAggregationForStructuredClassifier
import org.eclipse.uml2.uml.AggregationKind; //导入依赖的package包/类
/**
* Aggregation설정
*
* @param relationType
* @param umlModel
* @param supplier
* @param isNevigableSupplier
* @param client
* @param isNevigableClient
* void
*/
public static void setDirectedAggregationForStructuredClassifier(Association umlModel, NamedElement supplier,
NamedElement client) {
setAssociationForStructuredClassifier(umlModel,
supplier,
false,
AggregationKind.NONE_LITERAL,
client,
true,
AggregationKind.SHARED_LITERAL);
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:23,代码来源:UMLManager.java
示例7: setAggregationForBehavioredClassifier
import org.eclipse.uml2.uml.AggregationKind; //导入依赖的package包/类
/**
* setAggregationForBehavioredClassifier
*
* @param umlModel
* @param supplier
* @param client void
*/
public static void setAggregationForBehavioredClassifier(Association umlModel, NamedElement supplier,
NamedElement client) {
setAssociationForBehavioredClassifier(umlModel,
supplier,
true,
AggregationKind.SHARED_LITERAL,
client,
true,
AggregationKind.NONE_LITERAL);
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:18,代码来源:UMLManager.java
示例8: setCompositionForBehavioredClassifier
import org.eclipse.uml2.uml.AggregationKind; //导入依赖的package包/类
/**
* setCompositionForBehavioredClassifier
*
* @param umlModel
* @param supplier
* @param client void
*/
public static void setCompositionForBehavioredClassifier(Association umlModel, NamedElement supplier,
NamedElement client) {
setAssociationForBehavioredClassifier(umlModel,
supplier,
true,
AggregationKind.COMPOSITE_LITERAL,
client,
true,
AggregationKind.NONE_LITERAL);
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:18,代码来源:UMLManager.java
示例9: setDirectedAssociationForBehavioredClassifier
import org.eclipse.uml2.uml.AggregationKind; //导入依赖的package包/类
/**
* setDirectedAssociationForBehavioredClassifier
*
* @param umlModel
* @param supplier
* @param client void
*/
public static void setDirectedAssociationForBehavioredClassifier(Association umlModel, NamedElement supplier,
NamedElement client) {
setAssociationForBehavioredClassifier(umlModel,
supplier,
true,
AggregationKind.NONE_LITERAL,
client,
false,
AggregationKind.NONE_LITERAL);
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:18,代码来源:UMLManager.java
示例10: setDirectedAggregationForBehavioredClassifier
import org.eclipse.uml2.uml.AggregationKind; //导入依赖的package包/类
/**
* setDirectedAggregationForBehavioredClassifier
*
* @param umlModel
* @param supplier
* @param client void
*/
public static void setDirectedAggregationForBehavioredClassifier(Association umlModel, NamedElement supplier,
NamedElement client) {
setAssociationForBehavioredClassifier(umlModel,
supplier,
true,
AggregationKind.SHARED_LITERAL,
client,
false,
AggregationKind.NONE_LITERAL);
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:18,代码来源:UMLManager.java
示例11: setDirectedCompositionForBehavioredClassifier
import org.eclipse.uml2.uml.AggregationKind; //导入依赖的package包/类
/**
* setDirectedCompositionForBehavioredClassifier
*
* @param umlModel
* @param supplier
* @param client void
*/
public static void setDirectedCompositionForBehavioredClassifier(Association umlModel, NamedElement supplier,
NamedElement client) {
setAssociationForBehavioredClassifier(umlModel,
supplier,
true,
AggregationKind.COMPOSITE_LITERAL,
client,
false,
AggregationKind.NONE_LITERAL);
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:18,代码来源:UMLManager.java
示例12: createProperty
import org.eclipse.uml2.uml.AggregationKind; //导入依赖的package包/类
/**
*
* Propertuy 생성
*
* @param name
* @return org.eclipse.uml2.uml.Property
*/
public static org.eclipse.uml2.uml.Property createProperty(String name) {
org.eclipse.uml2.uml.Property property = FACTORY.createProperty();
property.setName(name);
property.setVisibility(VisibilityKind.PRIVATE_LITERAL);
property.setLower(1);
property.setUpper(1);
property.setAggregation(AggregationKind.NONE_LITERAL);
return property;
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:17,代码来源:UMLHelper.java
示例13: ModelCreatorOfClassDiagram
import org.eclipse.uml2.uml.AggregationKind; //导入依赖的package包/类
/**
* ModelCreatorOfClassDiagram
* @param targetClass
* @param objectType
* @param aggregationKindType
*/
@SuppressWarnings("unchecked")
public ModelCreatorOfClassDiagram(Class targetClass, UMLHelper.DirectedType objectType,
AggregationKind aggregationKindType) {
this(targetClass);
this.directedType = objectType;
this.aggregationKindType = aggregationKindType;
if (this.targetClass.equals(org.eclipse.uml2.uml.Association.class)) {
if (UMLHelper.DirectedType.BINARY.equals(objectType)) {
if (AggregationKind.NONE_LITERAL.equals(aggregationKindType)) {
this.viewModelType = RelationType.ASSOCIATION;
} else if (AggregationKind.COMPOSITE_LITERAL.equals(aggregationKindType)) {
this.viewModelType = RelationType.COMPOSITION;
} else if (AggregationKind.SHARED_LITERAL.equals(aggregationKindType)) {
this.viewModelType = RelationType.AGGREGATION;
}
} else {
if (AggregationKind.NONE_LITERAL.equals(aggregationKindType)) {
this.viewModelType = RelationType.DIRECTED_ASSOCIATION;
} else if (AggregationKind.COMPOSITE_LITERAL.equals(aggregationKindType)) {
this.viewModelType = RelationType.DIRECTED_COMPOSITION;
} else if (AggregationKind.SHARED_LITERAL.equals(aggregationKindType)) {
this.viewModelType = RelationType.DIRECTED_AGGREGATION;
}
}
}
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:33,代码来源:ModelCreatorOfClassDiagram.java
示例14: assocEnd
import org.eclipse.uml2.uml.AggregationKind; //导入依赖的package包/类
protected Property assocEnd(Class a, Classifier ab, String name, AggregationKind kind, int lowerBound, int upperBound,
boolean isNavigable) {
Property end;
if (ab instanceof Association) {
end = ((Association) ab).getOwnedEnd(name, null);
} else {
end = ((Class) ab).getOwnedAttribute(name, null);
}
assertEquals(a, end.getType());
assertEquals(kind, end.getAggregation());
assertEquals(lowerBound, end.getLower());
assertEquals(upperBound, end.getUpper());
assertEquals(isNavigable, end.isNavigable());
return end;
}
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:16,代码来源:UMLExportTestBase.java
示例15: testMemberEnd
import org.eclipse.uml2.uml.AggregationKind; //导入依赖的package包/类
private void testMemberEnd(String keyword, AggregationKind expected) throws CoreException {
String source = "";
source += "model simple;\n";
source += " class ClientWithAccountAttribute\n";
source += " attribute account : AccountWithClientAttribute;\n";
source += " end;\n";
source += " class AccountWithClientAttribute\n";
source += " attribute client : ClientWithAccountAttribute;\n";
source += " end;\n";
source += keyword + " AccountClient\n";
source += " role ClientWithAccountAttribute.account;\n";
source += " role AccountWithClientAttribute.client;\n";
source += "end;\n";
source += "end.";
parseAndCheck(source);
Class accountClass = (Class) getRepository().findNamedElement("simple::AccountWithClientAttribute",
IRepository.PACKAGE.getClass_(), null);
Class clientClass = (Class) getRepository().findNamedElement("simple::ClientWithAccountAttribute",
IRepository.PACKAGE.getClass_(), null);
final Association association = (Association) getRepository().findNamedElement("simple::AccountClient",
IRepository.PACKAGE.getAssociation(), null);
assertNotNull(association);
Property accountEnd = association.getOwnedEnd("account", accountClass);
assertNull(accountEnd);
accountEnd = association.getMemberEnd("account", accountClass);
assertNotNull(accountEnd);
assertEquals(expected, accountEnd.getAggregation());
Property clientEnd = association.getOwnedEnd("client", clientClass);
assertNull(clientEnd);
clientEnd = association.getMemberEnd("client", clientClass);
assertNotNull(clientEnd);
assertEquals(AggregationKind.NONE_LITERAL, clientEnd.getAggregation());
assertEquals(1, ((LiteralUnlimitedNatural) accountEnd.getLowerValue()).getValue());
assertEquals(1, ((LiteralUnlimitedNatural) accountEnd.getUpperValue()).getValue());
assertEquals(1, ((LiteralUnlimitedNatural) clientEnd.getLowerValue()).getValue());
assertEquals(1, ((LiteralUnlimitedNatural) clientEnd.getUpperValue()).getValue());
}
开发者ID:abstratt,项目名称:textuml,代码行数:38,代码来源:AssociationTests.java
示例16: testMixedMemberEnd
import org.eclipse.uml2.uml.AggregationKind; //导入依赖的package包/类
public void testMixedMemberEnd() throws CoreException {
String source = "";
source += "model simple;\n";
source += " class Parent\n";
source += " attribute children : Child[*];\n";
source += " end;\n";
source += " class Child\n";
source += " end;\n";
source += " composition Hierarchy\n";
source += " role Parent.children;\n";
source += " role parent : Parent;\n";
source += " end;\n";
source += "end.";
parseAndCheck(source);
Class parentClass = (Class) getRepository().findNamedElement("simple::Parent", IRepository.PACKAGE.getClass_(),
null);
Class childClass = (Class) getRepository().findNamedElement("simple::Child", IRepository.PACKAGE.getClass_(),
null);
final Association association = (Association) getRepository().findNamedElement("simple::Hierarchy",
IRepository.PACKAGE.getAssociation(), null);
Property parentEnd = association.getOwnedEnd("parent", parentClass);
assertNotNull(parentEnd);
assertEquals(AggregationKind.NONE_LITERAL, parentEnd.getAggregation());
Property childrenEnd = association.getOwnedEnd("children", childClass);
assertNull(childrenEnd);
childrenEnd = association.getMemberEnd("children", childClass);
assertNotNull(childrenEnd);
assertEquals(AggregationKind.COMPOSITE_LITERAL, childrenEnd.getAggregation());
assertEquals(0, ((LiteralInteger) childrenEnd.getLowerValue()).getValue());
assertEquals(LiteralUnlimitedNatural.UNLIMITED,
((LiteralUnlimitedNatural) childrenEnd.getUpperValue()).getValue());
assertEquals(1, ((LiteralUnlimitedNatural) parentEnd.getLowerValue()).getValue());
assertEquals(1, ((LiteralUnlimitedNatural) parentEnd.getUpperValue()).getValue());
}
开发者ID:abstratt,项目名称:textuml,代码行数:35,代码来源:AssociationTests.java
示例17: testSimpleAssociation
import org.eclipse.uml2.uml.AggregationKind; //导入依赖的package包/类
public void testSimpleAssociation() throws CoreException {
String source = "";
source += "model simple;\n";
source += "association AccountClient\n";
source += " role account : Account[*];\n";
source += " readonly !navigable role client : Client[1];\n";
source += "end;\n";
source += "end.";
parseAndCheck(getSimpleModelSource(), source);
Class accountClass = (Class) getRepository().findNamedElement("simple::Account",
IRepository.PACKAGE.getClass_(), null);
Class clientClass = (Class) getRepository().findNamedElement("simple::Client", IRepository.PACKAGE.getClass_(),
null);
final Association association = (Association) getRepository().findNamedElement("simple::AccountClient",
IRepository.PACKAGE.getAssociation(), null);
assertNotNull(association);
Property accountEnd = association.getOwnedEnd("account", accountClass);
assertNotNull(accountEnd);
assertTrue(accountEnd.isNavigable());
assertTrue(!accountEnd.isReadOnly());
assertEquals(AggregationKind.NONE_LITERAL, accountEnd.getAggregation());
Property clientEnd = association.getOwnedEnd("client", clientClass);
assertNotNull(clientEnd);
assertTrue(!clientEnd.isNavigable());
assertTrue(clientEnd.isReadOnly());
assertEquals(AggregationKind.NONE_LITERAL, clientEnd.getAggregation());
assertEquals(0, ((LiteralInteger) accountEnd.getLowerValue()).getValue());
assertEquals(LiteralUnlimitedNatural.UNLIMITED,
((LiteralUnlimitedNatural) accountEnd.getUpperValue()).getValue());
assertEquals(1, ((LiteralInteger) clientEnd.getLowerValue()).getValue());
assertEquals(1, ((LiteralUnlimitedNatural) clientEnd.getUpperValue()).getValue());
}
开发者ID:abstratt,项目名称:textuml,代码行数:33,代码来源:AssociationTests.java
示例18: testAssociationShorthand
import org.eclipse.uml2.uml.AggregationKind; //导入依赖的package包/类
public void testAssociationShorthand() throws CoreException {
String source = "";
source += "model simple;\n";
source += "class A\n";
source += "end;\n";
source += "class C\n";
source += "end;\n";
source += "class B\n";
source += " reference a : A;\n";
source += "end;\n";
source += "end.";
parseAndCheck(source);
Class classA = (Class) getRepository().findNamedElement("simple::A", IRepository.PACKAGE.getClass_(), null);
Class classB = (Class) getRepository().findNamedElement("simple::B", IRepository.PACKAGE.getClass_(), null);
Property propertyA = classB.getOwnedAttribute("a", null);
assertNotNull(propertyA);
Association association = propertyA.getAssociation();
assertNotNull(association);
assertTrue(association.getMemberEnds().contains(propertyA));
assertFalse(association.getOwnedEnds().contains(propertyA));
assertEquals(AggregationKind.NONE_LITERAL, propertyA.getAggregation());
assertSame(classA, propertyA.getType());
Property otherEnd = propertyA.getOtherEnd();
assertTrue(association.getMemberEnds().contains(otherEnd));
assertTrue(association.getOwnedEnds().contains(otherEnd));
assertEquals(AggregationKind.NONE_LITERAL, otherEnd.getAggregation());
assertSame(classB, otherEnd.getType());
}
开发者ID:abstratt,项目名称:textuml,代码行数:33,代码来源:AssociationTests.java
示例19: testAggregationShorthand
import org.eclipse.uml2.uml.AggregationKind; //导入依赖的package包/类
public void testAggregationShorthand() throws CoreException {
String source = "";
source += "model simple;\n";
source += "class A\n";
source += "end;\n";
source += "class C\n";
source += "end;\n";
source += "class B\n";
source += " aggregation a : A;\n";
source += "end;\n";
source += "end.";
parseAndCheck(source);
Class classA = (Class) getRepository().findNamedElement("simple::A", IRepository.PACKAGE.getClass_(), null);
Class classB = (Class) getRepository().findNamedElement("simple::B", IRepository.PACKAGE.getClass_(), null);
Property propertyA = classB.getOwnedAttribute("a", null);
assertNotNull(propertyA);
Association association = propertyA.getAssociation();
assertNotNull(association);
assertTrue(association.getMemberEnds().contains(propertyA));
assertFalse(association.getOwnedEnds().contains(propertyA));
assertEquals(AggregationKind.SHARED_LITERAL, propertyA.getAggregation());
assertSame(classA, propertyA.getType());
Property otherEnd = propertyA.getOtherEnd();
assertTrue(association.getMemberEnds().contains(otherEnd));
assertTrue(association.getOwnedEnds().contains(otherEnd));
assertEquals(AggregationKind.NONE_LITERAL, otherEnd.getAggregation());
assertSame(classB, otherEnd.getType());
}
开发者ID:abstratt,项目名称:textuml,代码行数:33,代码来源:AssociationTests.java
示例20: testCompositionShorthand
import org.eclipse.uml2.uml.AggregationKind; //导入依赖的package包/类
public void testCompositionShorthand() throws CoreException {
String source = "";
source += "model simple;\n";
source += "class A\n";
source += "end;\n";
source += "class C\n";
source += "end;\n";
source += "class B\n";
source += " composition a : A;\n";
source += "end;\n";
source += "end.";
parseAndCheck(source);
Class classA = (Class) getRepository().findNamedElement("simple::A", IRepository.PACKAGE.getClass_(), null);
Class classB = (Class) getRepository().findNamedElement("simple::B", IRepository.PACKAGE.getClass_(), null);
Property propertyA = classB.getOwnedAttribute("a", null);
assertNotNull(propertyA);
Association association = propertyA.getAssociation();
assertNotNull(association);
assertTrue(association.getMemberEnds().contains(propertyA));
assertFalse(association.getOwnedEnds().contains(propertyA));
assertEquals(AggregationKind.COMPOSITE_LITERAL, propertyA.getAggregation());
assertSame(classA, propertyA.getType());
Property otherEnd = propertyA.getOtherEnd();
assertTrue(association.getMemberEnds().contains(otherEnd));
assertTrue(association.getOwnedEnds().contains(otherEnd));
assertEquals(AggregationKind.NONE_LITERAL, otherEnd.getAggregation());
assertSame(classB, otherEnd.getType());
}
开发者ID:abstratt,项目名称:textuml,代码行数:33,代码来源:AssociationTests.java
注:本文中的org.eclipse.uml2.uml.AggregationKind类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论