本文整理了Java中org.eclipse.ocl.Query.check
方法的一些代码示例,展示了Query.check
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.check
方法的具体详情如下:
包路径:org.eclipse.ocl.Query
类名称: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$
}
}
内容来源于网络,如有侵权,请联系作者删除!