本文整理了Java中org.eclipse.uml2.uml.Operation.getBodyCondition()
方法的一些代码示例,展示了Operation.getBodyCondition()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Operation.getBodyCondition()
方法的具体详情如下:
包路径:org.eclipse.uml2.uml.Operation
类名称:Operation
方法名:getBodyCondition
[英]Returns the value of the 'Body Condition' reference.
This feature subsets the following features:
An optional Constraint on the result values of an invocation of this Operation.
[中]返回“Body Condition”引用的值。
此功能是以下功能的子集:
*“组织。日食uml2。uml。命名空间#getOwnedRules()'
对调用此操作的结果值的可选约束。
代码示例来源:origin: org.umlg/java-generation-util
@Override
public Constraint getBodyCondition() {
return this.operation.getBodyCondition();
}
代码示例来源:origin: org.umlg/java-generation
@Override
public void visitBefore(Operation oper) {
Element operOwner = oper.getOwner();
if (oper.getBodyCondition() != null && !oper.isQuery()) {
throw new IllegalStateException(String.format("Operation %s on %s has a bodyCondition but is not a query.",
new Object[] { oper.getName(), ((NamedElement) operOwner).getName() }));
}
OJAnnotatedClass ojClass;
if (operOwner instanceof Interface) {
ojClass = findOJClass((Interface) operOwner);
addOperSignature(ojClass, oper);
} else if ((operOwner instanceof org.eclipse.uml2.uml.Class) || (operOwner instanceof Enumeration)) {
ojClass = findOJClass((org.eclipse.uml2.uml.Classifier) operOwner);
OJAnnotatedOperation ojOper = addOperSignature(ojClass, oper);
if (oper.isQuery()) {
addQueryBody(ojClass, ojOper, oper);
}
} else {
throw new IllegalStateException("Operations are only supported on Interfaces and Classes, not on " + operOwner.toString());
}
}
代码示例来源:origin: org.eclipse.uml2/org.eclipse.uml2.uml
Constraint bodyCondition = operation.getBodyCondition();
代码示例来源:origin: org.eclipse.uml2/org.eclipse.uml2.uml
Constraint bodyCondition = operation.getBodyCondition();
代码示例来源:origin: org.eclipse.uml2/org.eclipse.uml2.uml
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* A bodyCondition can only be specified for a query operation.
* bodyCondition->notEmpty() implies isQuery
* @param operation The receiving '<em><b>Operation</b></em>' model object.
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @generated NOT
*/
public static boolean validateOnlyBodyForQuery(Operation operation,
DiagnosticChain diagnostics, Map<Object, Object> context) {
boolean result = true;
if (operation.getBodyCondition() != null && !operation.isQuery()) {
result = false;
if (diagnostics != null) {
diagnostics.add(new BasicDiagnostic(Diagnostic.WARNING,
UMLValidator.DIAGNOSTIC_SOURCE,
UMLValidator.OPERATION__ONLY_BODY_FOR_QUERY,
UMLPlugin.INSTANCE.getString(
"_UI_Operation_OnlyBodyForQuery_diagnostic", //$NON-NLS-1$
getMessageSubstitutions(context, operation)),
new Object[]{operation}));
}
}
return result;
}
内容来源于网络,如有侵权,请联系作者删除!