org.eclipse.uml2.uml.Operation.isQuery()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(228)

本文整理了Java中org.eclipse.uml2.uml.Operation.isQuery()方法的一些代码示例,展示了Operation.isQuery()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Operation.isQuery()方法的具体详情如下:
包路径:org.eclipse.uml2.uml.Operation
类名称:Operation
方法名:isQuery

Operation.isQuery介绍

[英]Returns the value of the 'Is Query' attribute. The default value is "false". Specifies whether an execution of the BehavioralFeature leaves the state of the system unchanged (isQuery=true) or whether side effects may occur (isQuery=false).
[中]返回“Is Query”属性的值。默认值为[$0$]。指定执行BehavioralFeature时是否保持系统状态不变(isQuery=true),或是否可能出现副作用(isQuery=false)。

代码示例

代码示例来源:origin: org.andromda.bootstrap.metafacades/andromda-metafacades-emf-uml22

/**
 * @see org.andromda.metafacades.uml.OperationFacade#isQuery()
 */
@Override
protected boolean handleIsQuery()
{
  return this.metaObject.isQuery();
}

代码示例来源:origin: org.andromda.metafacades/andromda-metafacades-emf-uml22

/**
 * @see org.andromda.metafacades.uml.OperationFacade#isQuery()
 */
@Override
protected boolean handleIsQuery()
{
  return this.metaObject.isQuery();
}

代码示例来源:origin: org.eclipse.ocl/uml

public boolean isQuery(Operation operation) {
  return operation.isQuery();
}

代码示例来源: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

/**
 * <!-- 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;
}

相关文章