本文整理汇总了Java中org.eclipse.uml2.uml.Element.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java Element.getValue方法的具体用法?Java Element.getValue怎么用?Java Element.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.uml2.uml.Element
的用法示例。
在下文中一共展示了Element.getValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStereotypeListValue
import org.eclipse.uml2.uml.Element; //导入方法依赖的package包/类
/**
* Returns the value cast as an List.
*
* @param clazz
* @param stereotypeName
* @param propertyName
* @return
*/
public static List<?> getStereotypeListValue(Element clazz, String stereotypeName, String propertyName) {
Stereotype stereotype = getStereotype(clazz, stereotypeName);
if (stereotype != null) {
try {
Object value = clazz.getValue(stereotype, propertyName);
if (value instanceof List) {
List<?> new_name = (List<?>) value;
return new_name;
}
} catch (IllegalArgumentException e) {
}
}
return new ArrayList<Object>();
}
示例2: getStereotypeValue
import org.eclipse.uml2.uml.Element; //导入方法依赖的package包/类
/**
* Return the value of the the stereotype property.
*
* @param clazz
* @param stereotypeName
* @param propertyName
* @return
*/
public static Object getStereotypeValue(Element clazz, String stereotypeName, String propertyName) {
Stereotype stereotype = getStereotype(clazz, stereotypeName);
if (stereotype != null) {
Object value = clazz.getValue(stereotype, propertyName);
return value;
}
return null;
}
示例3: applyStereotype
import org.eclipse.uml2.uml.Element; //导入方法依赖的package包/类
/**
* 요소에 스테레오타입 이름에 해당하는 스테레오타입을 찾아 적용하는 메소드
*
* @param source
* @param target
* @param stereotypeName
* @return
*/
private static Stereotype applyStereotype(Element source, Element target, String stereotypeName) {
// null 확인
if (source == null || target == null || stereotypeName == null) {
return null;
}
Stereotype stereotype = target.getAppliedStereotype(stereotypeName);
if (stereotype == null) {
stereotype = getApplicableStereotype(target, stereotypeName);
if (stereotype != null) {
if (!isAppliedStereotype(target, stereotypeName)) {
target.applyStereotype(stereotype);
// 소스와 타겟에 같은 스테레오타입이 적용되어 있을 때는 스테레오타입의 특성값도 함께 적용해준다.
Stereotype sType = source.getAppliedStereotype(stereotype.getQualifiedName());
if( null != sType) {
EList<Property> attributes = sType.getAllAttributes();
for (Property property : attributes) {
String propertyName = property.getName();
Object obj = source.getValue(sType, propertyName);
if( null != obj && !propertyName.startsWith(Extension.METACLASS_ROLE_PREFIX)) {
target.setValue(stereotype, propertyName, obj);
}
}
}
}
}
}
return stereotype;
}