| /******************************************************************************* |
| * Copyright (c) 2011, 2017 Willink Transformations and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * E.D.Willink - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.qvtd.pivot.qvtbase; |
| |
| import java.util.Map; |
| import org.eclipse.emf.common.util.DiagnosticChain; |
| import org.eclipse.ocl.pivot.Element; |
| import org.eclipse.ocl.pivot.OCLExpression; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * A representation of the model object '<em><b>Predicate</b></em>'. |
| * <!-- end-user-doc --> |
| * |
| * <p> |
| * The following features are supported: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.qvtd.pivot.qvtbase.Predicate#getConditionExpression <em>Condition Expression</em>}</li> |
| * <li>{@link org.eclipse.qvtd.pivot.qvtbase.Predicate#getPattern <em>Pattern</em>}</li> |
| * </ul> |
| * |
| * @see org.eclipse.qvtd.pivot.qvtbase.QVTbasePackage#getPredicate() |
| * @model |
| * @generated |
| */ |
| public interface Predicate extends Element { |
| /** |
| * Returns the value of the '<em><b>Condition Expression</b></em>' containment reference. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of the '<em>Condition Expression</em>' containment reference isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @return the value of the '<em>Condition Expression</em>' containment reference. |
| * @see #setConditionExpression(OCLExpression) |
| * @see org.eclipse.qvtd.pivot.qvtbase.QVTbasePackage#getPredicate_ConditionExpression() |
| * @model containment="true" required="true" |
| * annotation="http://schema.omg.org/spec/MOF/2.0/emof.xml#Property.oppositeRoleName body='predicate'" |
| * annotation="http://www.eclipse.org/emf/2002/GenModel get='throw new UnsupportedOperationException(); // FIXME Unimplemented http://www.eclipse.org/qvt/2015/QVTbase!Predicate!conditionExpression'" |
| * @generated |
| */ |
| OCLExpression getConditionExpression(); |
| |
| /** |
| * Sets the value of the '{@link org.eclipse.qvtd.pivot.qvtbase.Predicate#getConditionExpression <em>Condition Expression</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @param value the new value of the '<em>Condition Expression</em>' containment reference. |
| * @see #getConditionExpression() |
| * @generated |
| */ |
| void setConditionExpression(OCLExpression value); |
| |
| /** |
| * Returns the value of the '<em><b>Pattern</b></em>' container reference. |
| * It is bidirectional and its opposite is '{@link org.eclipse.qvtd.pivot.qvtbase.Pattern#getPredicate <em>Predicate</em>}'. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of the '<em>Pattern</em>' container reference isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @return the value of the '<em>Pattern</em>' container reference. |
| * @see #setPattern(Pattern) |
| * @see org.eclipse.qvtd.pivot.qvtbase.QVTbasePackage#getPredicate_Pattern() |
| * @see org.eclipse.qvtd.pivot.qvtbase.Pattern#getPredicate |
| * @model opposite="predicate" required="true" |
| * annotation="http://www.eclipse.org/emf/2002/GenModel get='throw new UnsupportedOperationException(); // FIXME Unimplemented http://www.eclipse.org/qvt/2015/QVTbase!Predicate!pattern'" |
| * @generated |
| */ |
| Pattern getPattern(); |
| |
| /** |
| * Sets the value of the '{@link org.eclipse.qvtd.pivot.qvtbase.Predicate#getPattern <em>Pattern</em>}' container reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @param value the new value of the '<em>Pattern</em>' container reference. |
| * @see #getPattern() |
| * @generated |
| */ |
| void setPattern(Pattern value); |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @model annotation="http://www.eclipse.org/uml2/2.0.0/UML originalName='ConditionIsBoolean'" |
| * annotation="http://www.eclipse.org/emf/2002/GenModel body='/**\n *\n * inv ConditionIsBoolean:\n * let severity : Integer[1] = \'Predicate::ConditionIsBoolean\'.getSeverity()\n * in\n * if severity <= 0\n * then true\n * else\n * let result : Boolean[1] = conditionExpression.type = Boolean\n * in\n * \'Predicate::ConditionIsBoolean\'.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0)\n * endif\n \052/\nfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.evaluation.@<%org.eclipse.jdt.annotation.NonNull%> Executor executor = <%org.eclipse.ocl.pivot.internal.utilities.PivotUtilInternal%>.getExecutor(this);\nfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.ids.@<%org.eclipse.jdt.annotation.NonNull%> IdResolver idResolver = executor.getIdResolver();\nfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.values.@<%org.eclipse.jdt.annotation.NonNull%> IntegerValue severity_0 = <%org.eclipse.ocl.pivot.library.string.CGStringGetSeverityOperation%>.INSTANCE.evaluate(executor, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.STR_Predicate_c_c_ConditionIsBoolean);\nfinal /*@NonInvalid\052/ boolean le = <%org.eclipse.ocl.pivot.library.oclany.OclComparableLessThanEqualOperation%>.INSTANCE.evaluate(executor, severity_0, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.INT_0).booleanValue();\n/*@NonInvalid\052/ boolean symbol_0;\nif (le) {\n\tsymbol_0 = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE;\n}\nelse {\n\tfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> Class TYP_Boolean = idResolver.getClass(<%org.eclipse.ocl.pivot.ids.TypeId%>.BOOLEAN, null);\n\t@SuppressWarnings(\"null\")\n\tfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.NonNull%> OCLExpression conditionExpression = this.getConditionExpression();\n\tfinal /*@NonInvalid\052/ org.eclipse.ocl.pivot.@<%org.eclipse.jdt.annotation.Nullable%> Type type = conditionExpression.getType();\n\tfinal /*@NonInvalid\052/ boolean result = (type != null) ? (type.getTypeId() == TYP_Boolean.getTypeId()) : false;\n\tfinal /*@NonInvalid\052/ boolean logDiagnostic = <%org.eclipse.ocl.pivot.library.string.CGStringLogDiagnosticOperation%>.INSTANCE.evaluate(executor, <%org.eclipse.ocl.pivot.ids.TypeId%>.BOOLEAN, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.STR_Predicate_c_c_ConditionIsBoolean, this, (Object)null, diagnostics, context, (Object)null, severity_0, result, <%org.eclipse.qvtd.pivot.qvtbase.QVTbaseTables%>.INT_0).booleanValue();\n\tsymbol_0 = logDiagnostic;\n}\nreturn Boolean.TRUE == symbol_0;'" |
| * @generated |
| */ |
| boolean validateConditionIsBoolean(DiagnosticChain diagnostics, Map<Object, Object> context); |
| |
| } // Predicate |