本文整理汇总了Java中org.eclipse.uml2.uml.Package.getPackagedElements方法的典型用法代码示例。如果您正苦于以下问题:Java Package.getPackagedElements方法的具体用法?Java Package.getPackagedElements怎么用?Java Package.getPackagedElements使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.uml2.uml.Package
的用法示例。
在下文中一共展示了Package.getPackagedElements方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSortedAllPackageChildrenList
import org.eclipse.uml2.uml.Package; //导入方法依赖的package包/类
/**
* getSortedAllPackageChildrenList
*
* @param parent
* @return List<T>
*/
@SuppressWarnings("unchecked")
public List<T> getSortedAllPackageChildrenList(Package parent) {
List<PackageableElement> packagedElements = parent.getPackagedElements();
List<T> list = new ArrayList<T>();
for (PackageableElement packagedElement : packagedElements) {
if (packagedElement.eClass().equals(UMLPackage.Literals.PACKAGE)) {
list.add((T) packagedElement);
}
}
sorting(list);
if (list.size() > 0) {
Object arrayList[] = list.toArray();
for (int i = 0; i < arrayList.length; i++) {
Package packageElement = (Package) arrayList[i];
List<T> childrenList = getSortedAllPackageChildrenList(packageElement);
if (childrenList.size() > 0) {
list.addAll(childrenList);
}
}
}
return list;
}
示例2: createDiagramDataModelList
import org.eclipse.uml2.uml.Package; //导入方法依赖的package包/类
/**
* Diagram 데이터 모델 리스트를 생성합니다.
*
* @param pkg
* @return List<DataModel>
*/
private List<DataModel> createDiagramDataModelList(Package pack) throws Exception {
List<DataModel> diagramModelList = new ArrayList<DataModel>();
EAnnotation annotation = null;
Diagram diagram;
for (PackageableElement element : pack.getPackagedElements()) {
if (element.eClass() == UMLPackage.Literals.COLLABORATION) {
annotation = element.getEAnnotation(UICoreConstant.PROJECT_CONSTANTS__DIAGRAM);
if (annotation != null) {
for (EObject eobj : annotation.getContents()) {
if (eobj.eClass() == UMLDiagramPackage.Literals.DIAGRAM) {
diagram = (Diagram) eobj;
if (diagram.getType() == DiagramType.CLASS_DIAGRAM) {
diagramModelList.add(createDiagramModel(diagram));
}
}
}
}
}
}
// if (eObject.eClass() == UMLPackage.Literals.PACKAGE
// || eObject.eClass() == UMLPackage.Literals.MODEL) {
// Package pkg = (Package) eObject;
// for (PackageableElement element : pkg.getPackagedElements()) {
// diagramModelList.addAll(createDiagramDataModelList(element));
// }
// }
return diagramModelList;
}
示例3: createClassDataModelList
import org.eclipse.uml2.uml.Package; //导入方法依赖的package包/类
/**
* Class 데이터 모델 리스트를 생성합니다.
*
* @param pkg
* @return List<DataModel>
*/
private List<DataModel> createClassDataModelList(Package pkg) {
List<DataModel> classModelList = new ArrayList<DataModel>();
DataModel classModel;
List<PackageableElement> list = pkg.getPackagedElements();
List<Class> classes = new ArrayList<Class>();
for (PackageableElement packageableElement : list) {
if (packageableElement.eClass() == UMLPackage.Literals.CLASS) {
classes.add((Class) packageableElement);
}
}
ProjectUtil.getSortedList(classes);
if (!classes.isEmpty()) {
for (Class clazz : classes) {
classModel = new DataModel();
setDataModel(classModel, UICoreConstant.REPORT__CLASS_NAME, clazz.getName());
setDataModel(classModel, UICoreConstant.REPORT__CLASS_STEREOTYPE, ProjectUtil.getStereotypeLabel(clazz));
setDataModel(classModel,
UICoreConstant.REPORT__CLASS_DOCUMENTATION,
getCommentToString(clazz.getOwnedComments()));
setDataModel(classModel, UICoreConstant.REPORT__ATTRIBUTE_LIST, createAttributeDataModelList(clazz));
setDataModel(classModel, UICoreConstant.REPORT__OPERATION_LIST, createOperationDataModelList(clazz));
classModelList.add(classModel);
}
}
return classModelList;
}