org.eclipse.ocl.Query.check()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(295)

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

Query.check介绍

[英]Evaluates the query on an object. The query must be a boolean valued constraint.
[中]计算对象上的查询。查询必须是布尔值约束。

代码示例

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

public boolean check(Object obj) {
  return delegate.check(obj);
}

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

public boolean check(List<?> objects) {
  return delegate.check(objects);
}

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

public boolean check(Object obj) {
  return delegate.check(obj);
}

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

public boolean check(List<?> objects) {
  return delegate.check(objects);
}

代码示例来源:origin: org.jresearch.flexess.client/org.jresearch.flexess.client.impl

private static boolean checkPermission(final EObject pObjectInstance, final EObject permissionInstance) {
  final Permission permission = (Permission) permissionInstance.eClass();
  permissionInstance.eSet(permission.getEStructuralFeature(IPermissionConstant.OBJECT), pObjectInstance);
  final String expession = permission.getConstraint().getExpession();
  final OCL<?, EClassifier, ?, ?, ?, ?, ?, ?, ?, Constraint, EClass, EObject> ocl = OCL.newInstance(EcoreEnvironmentFactory.INSTANCE);
  final OCLHelper<EClassifier, ?, ?, Constraint> helper = ocl.createOCLHelper();
  helper.setContext(permission);
  try {
    final Constraint constraint = helper.createInvariant(expession);
    final Query<EClassifier, EClass, EObject> constraintEval = ocl.createQuery(constraint);
    return constraintEval.check(permissionInstance);
  } catch (final ParserException e) {
    throw new UamClientException(MessageFormat.format("Incorrect expression: {0}. {1}", expession, e.getLocalizedMessage()), e); //$NON-NLS-1$
  }
}

相关文章