当前位置: 首页>>代码示例>>Java>>正文


Java Package.getPackagedElements方法代码示例

本文整理汇总了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;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:31,代码来源:UMLEnumerator.java

示例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;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:37,代码来源:CreateClassDefinitionToXMLFileJob.java

示例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;

}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:42,代码来源:CreateClassDefinitionToXMLFileJob.java


注:本文中的org.eclipse.uml2.uml.Package.getPackagedElements方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。