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


Java Element.getAppliedStereotypes方法代码示例

本文整理汇总了Java中org.eclipse.uml2.uml.Element.getAppliedStereotypes方法的典型用法代码示例。如果您正苦于以下问题:Java Element.getAppliedStereotypes方法的具体用法?Java Element.getAppliedStereotypes怎么用?Java Element.getAppliedStereotypes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.uml2.uml.Element的用法示例。


在下文中一共展示了Element.getAppliedStereotypes方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getComponentElementList

import org.eclipse.uml2.uml.Element; //导入方法依赖的package包/类
/**
 * 선택된 요소 전체목록 중에서 component 메타데이터 생성에 쓰이는 스테레오타입이 적용된 요소의 목록을 반환
 * 
 * @param selectedElementList
 * @return List<Element>
 */
public static List<Element> getComponentElementList(List<Element> selectedElementList) {
    List<Element> componentElementList = null;

    for (Element element : selectedElementList) {
        for (Stereotype appliedStereotype : element.getAppliedStereotypes()) {
            if (appliedStereotype.getLabel().equals(
                    MDDCoreConstant.COMPONENT_METADATA_STEREOTYPE_NAME)) {
                if (componentElementList == null) {
                    componentElementList = new ArrayList<Element>();
                }

                componentElementList.add(element);
            }
        }
    }

    return componentElementList;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:25,代码来源:NexcoreMDACUtil.java

示例2: getAppliedStereotypes

import org.eclipse.uml2.uml.Element; //导入方法依赖的package包/类
/**
 * Element에 적용된 스테레오타입을 텍스트로 반환한다.
 * 
 * @param element
 * @return String
 */
public static String getAppliedStereotypes(Element element) {
    if (element == null) {
        return null;
    }
    EList<Stereotype> appliedStereotypes = element.getAppliedStereotypes();
    Stereotype stereotype = null;
    if (appliedStereotypes != null) {
        StringBuffer stringBuffer = new StringBuffer();

        int sequence = 0;
        for (Iterator<Stereotype> iter = appliedStereotypes.iterator(); iter.hasNext();) {
            stereotype = iter.next();
            if (sequence > 0) {
                stringBuffer.append(UICoreConstant.PROJECT_CONSTANTS__COMMA);
            }
            stringBuffer.append(stereotype.getName().trim());
            sequence++;

        }
        return stringBuffer.toString();
    }
    return UICoreConstant.PROJECT_CONSTANTS__EMPTY_STRING;

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

示例3: findNotationNode

import org.eclipse.uml2.uml.Element; //导入方法依赖的package包/类
/**
 * 
 * 
 * @param element
 * @return AbstractNode
 */
protected AbstractNode findNotationNode(Element element) {
    if (null == element) {
        return null;
    }
    element.getAppliedStereotypes();
    Element target = null;
    if (element instanceof ExtensionPoint) {
        target = ((ExtensionPoint) element).getOwner();
    } else {
        target = element;
    }
    for (AbstractNode node : this.viewModelListInDiagram) {
        if (target.equals(node.getUmlModel())) {
            return node;
        }
    }
    return null;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:25,代码来源:DiagramRegerate.java

示例4: hasStereotype

import org.eclipse.uml2.uml.Element; //导入方法依赖的package包/类
/**
 * Returns true when the stereotype is applied to the {@link Element}.
 * 
 * @param clazz
 * @param stereotypeName
 * @return
 */
public static boolean hasStereotype(Element clazz, String stereotypeName) {
	if(clazz==null) return false;
	List<Stereotype> stereotypes = clazz.getAppliedStereotypes();
	for (Stereotype stereotype : stereotypes) {
		if (stereotype.getName().equals(stereotypeName)) {
			return true;
		}
	}
	return false;
}
 
开发者ID:UrsZeidler,项目名称:uml2solidity,代码行数:18,代码来源:Uml2Service.java

示例5: getStereotype

import org.eclipse.uml2.uml.Element; //导入方法依赖的package包/类
/**
 * Returns the stereotype.
 * 
 * @param clazz
 * @param stereotypeName
 * @return
 */
public static Stereotype getStereotype(Element clazz, String stereotypeName) {
	if(clazz==null) return null;
	List<Stereotype> stereotypes = clazz.getAppliedStereotypes();
	for (Stereotype stereotype : stereotypes) {
		if (stereotype.getName().equals(stereotypeName)) {
			return stereotype;
		}
	}
	return null;
}
 
开发者ID:UrsZeidler,项目名称:uml2solidity,代码行数:18,代码来源:Uml2Service.java

示例6: getComponentId

import org.eclipse.uml2.uml.Element; //导入方法依赖的package包/类
/**
 * component 요소로부터 id 가져오기
 * 
 * @param componentElement
 * @return String
 */
public static String getComponentId(Element componentElement) {
    // 참조할 스테레오타입 정보 가져오기
    Stereotype sourceStereotype = null;

    for (Stereotype appliedStereotype : componentElement
            .getAppliedStereotypes()) {
        if (appliedStereotype.getLabel().equals(
                MDDCoreConstant.COMPONENT_METADATA_STEREOTYPE_NAME)) {
            sourceStereotype = appliedStereotype;
            break;
        }
    }

    String taggedValue = MDDCoreConstant.EMPTY_STRING;

    // fqId 값 가져오기
    taggedValue = (String) UMLUtil.getTaggedValue(componentElement,
            sourceStereotype.getQualifiedName(),
            MDDCoreConstant.FQ_ID_KEY_IN_COMPONENT_STEREOTYPE);
    
    // 스테레오타입 속성에 값이 없을 때는 만들어서 리턴한다.
    if (taggedValue == null || taggedValue.length() == 0) {
        return createComponentFqId(componentElement);
    }

    return taggedValue;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:34,代码来源:NexcoreMDACUtil.java

示例7: getMethodElementList

import org.eclipse.uml2.uml.Element; //导入方法依赖的package包/类
/**
 * 선택된 BizUnit 요소 하위목록 중에서 method 스테레오타입이 적용된 요소의 목록을 반환
 * 
 * @param bizUnitElement
 * @return List<Element>
 */
public static List<Element> getMethodElementList(Element bizUnitElement) {
    List<Element> allElementChildList = null;
    List<Element> methodChildElementList = null;

    if (!bizUnitElement.getOwnedElements().isEmpty()
            && bizUnitElement.getOwnedElements().size() > 0) {
        allElementChildList = bizUnitElement.getOwnedElements();
    }
    
    if (null != allElementChildList) {
        for (Element childElement : allElementChildList) {
            for (Stereotype appliedStereotype : childElement
                    .getAppliedStereotypes()) {
                if (appliedStereotype
                        .getLabel()
                        .equals(
                                MDDCoreConstant.BIZUNIT_METADATA_METHOD_STEREOTYPE_NAME)) {
                    if (methodChildElementList == null) {
                        methodChildElementList = new ArrayList<Element>();
                    }

                    methodChildElementList.add(childElement);
                }
            }
        }
    }
    return methodChildElementList;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:35,代码来源:NexcoreMDACUtil.java

示例8: isAppliedStereotype

import org.eclipse.uml2.uml.Element; //导入方法依赖的package包/类
/**
 * check if the element is applied with the stereotype
 * 
 * @param element
 * @param stereotypeName
 * @return
 */
public static boolean isAppliedStereotype(Element element, String stereotypeName) {
    if (element == null || stereotypeName == null)
        return false;
    EList<Stereotype> stList = element.getAppliedStereotypes();
    if (stList != null)
        for (Iterator<Stereotype> iter = stList.iterator(); iter.hasNext();) {
            Stereotype st = iter.next();
            if (st.getName().equals(stereotypeName))
                return true;
        }

    return false;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:21,代码来源:MDADesignerTransformationUtil.java

示例9: clearStereotype

import org.eclipse.uml2.uml.Element; //导入方法依赖的package包/类
/**
 * clearStereotype
 *  
 * @param element void
 */
public static void clearStereotype(Element element) {

    for (Stereotype stereotype : element.getAppliedStereotypes()) {
        element.unapplyStereotype(stereotype);
        // 스테레오 타입이 삭제되면 도구가 다시 실행되기 전까지 항목이 안보임
        // UMLManager.deleteElement(stereotype);
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:14,代码来源:UMLManager.java

示例10: getStereotypeText

import org.eclipse.uml2.uml.Element; //导入方法依赖的package包/类
/**
 * NamedElement에 적용된 스테레오 타입이나 키워드 텍스트를 리턴한다.
 * 
 * @param namedElement
 * @return String
 */
public static String getStereotypeText(Element element) {

    String text = UICoreConstant.PROJECT_CONSTANTS__EMPTY_STRING;
    if (element == null) {
        return text;
    }

    EList<String> keywordsList = element.getKeywords();
    EList<Stereotype> stereotypeList = element.getAppliedStereotypes();
    ArrayList<String> typeName = new ArrayList<String>();

    for (int i = 0; i < keywordsList.size(); i++)
        typeName.add(keywordsList.get(i));
    for (int i = 0; i < stereotypeList.size(); i++)
        typeName.add(stereotypeList.get(i).getName());

    if (typeName.size() != 0) {
        for (int i = 0; i < typeName.size(); i++) {
            if (i != 0)
                text = text + UICoreConstant.PROJECT_CONSTANTS__COMMA;
            text = text + typeName.get(i);
        }
    }

    return text;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:33,代码来源:ProjectUtil.java


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