1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
/*******************************************************************************
* Copyright (c) 2011, 2019 Willink Transformations and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* E.D.Willink - initial API and implementation
*******************************************************************************/
package org.eclipse.qvtd.pivot.qvttemplate;
import java.util.Map;
import org.eclipse.emf.common.util.DiagnosticChain;
import org.eclipse.emf.common.util.EList;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Object Template Exp</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link org.eclipse.qvtd.pivot.qvttemplate.ObjectTemplateExp#getPart <em>Part</em>}</li>
* <li>{@link org.eclipse.qvtd.pivot.qvttemplate.ObjectTemplateExp#getReferredClass <em>Referred Class</em>}</li>
* </ul>
*
* @see org.eclipse.qvtd.pivot.qvttemplate.QVTtemplatePackage#getObjectTemplateExp()
* @model
* @generated
*/
public interface ObjectTemplateExp extends TemplateExp {
/**
* Returns the value of the '<em><b>Part</b></em>' containment reference list.
* The list contents are of type {@link org.eclipse.qvtd.pivot.qvttemplate.PropertyTemplateItem}.
* It is bidirectional and its opposite is '{@link org.eclipse.qvtd.pivot.qvttemplate.PropertyTemplateItem#getObjContainer <em>Obj Container</em>}'.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Part</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Part</em>' containment reference list.
* @see org.eclipse.qvtd.pivot.qvttemplate.QVTtemplatePackage#getObjectTemplateExp_Part()
* @see org.eclipse.qvtd.pivot.qvttemplate.PropertyTemplateItem#getObjContainer
* @model opposite="objContainer" containment="true" ordered="false"
* annotation="http://www.eclipse.org/emf/2002/GenModel get='throw new UnsupportedOperationException(); // FIXME Unimplemented http://www.eclipse.org/qvt/2015/QVTtemplate!ObjectTemplateExp!part'"
* @generated
*/
EList<PropertyTemplateItem> getPart();
/**
* Returns the value of the '<em><b>Referred Class</b></em>' reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Referred Class</em>' reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Referred Class</em>' reference.
* @see #setReferredClass(org.eclipse.ocl.pivot.Class)
* @see org.eclipse.qvtd.pivot.qvttemplate.QVTtemplatePackage#getObjectTemplateExp_ReferredClass()
* @model required="true"
* annotation="http://www.eclipse.org/emf/2002/GenModel get='throw new UnsupportedOperationException(); // FIXME Unimplemented http://www.eclipse.org/qvt/2015/QVTtemplate!ObjectTemplateExp!referredClass'"
* @generated
*/
org.eclipse.ocl.pivot.Class getReferredClass();
/**
* Sets the value of the '{@link org.eclipse.qvtd.pivot.qvttemplate.ObjectTemplateExp#getReferredClass <em>Referred Class</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Referred Class</em>' reference.
* @see #getReferredClass()
* @generated
*/
void setReferredClass(org.eclipse.ocl.pivot.Class value);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @model annotation="http://www.eclipse.org/uml2/2.0.0/UML originalName='PartPropertyIsUnique'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot body='\n\tpart->isUnique(resolvedProperty)\n\n'"
* annotation="http://www.eclipse.org/emf/2002/GenModel body='final <%java.lang.<%@<%org.eclipse.jdt.annotation.NonNull%> %>String%> constraintName = \"ObjectTemplateExp::PartPropertyIsUnique\";\ntry {\n\t/**\n\t *\n\t * inv PartPropertyIsUnique:\n\t * let severity : Integer[1] = constraintName.getSeverity()\n\t * in\n\t * if severity <= 0\n\t * then true\n\t * else\n\t * let\n\t * result : Boolean[1] = part->isUnique(resolvedProperty)\n\t * in\n\t * constraintName.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0)\n\t * endif\n\t \052/\n\tfinal /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.evaluation.<%@<%org.eclipse.jdt.annotation.NonNull%> %>Executor%> executor = <%org.eclipse.ocl.pivot.utilities.PivotUtil%>.getExecutor(this, context);\n\tfinal /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.ids.<%@<%org.eclipse.jdt.annotation.NonNull%> %>IdResolver%> idResolver = executor.getIdResolver();\n\t/*@Caught\052/ <%<%@<%org.eclipse.jdt.annotation.NonNull%> %>Object%> CAUGHT_severity_0;\n\ttry {\n\t\tfinal /*@Thrown\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.qvttemplate.QVTtemplatePackage%>.Literals.OBJECT_TEMPLATE_EXP___VALIDATE_PART_PROPERTY_IS_UNIQUE__DIAGNOSTICCHAIN_MAP);\n\t\tCAUGHT_severity_0 = severity_0;\n\t}\n\tcatch (<%java.lang.Exception%> e) {\n\t\tCAUGHT_severity_0 = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.createInvalidValue(e);\n\t}\n\tif (CAUGHT_severity_0 instanceof <%org.eclipse.ocl.pivot.values.InvalidValueException%>) {\n\t\tthrow (<%org.eclipse.ocl.pivot.values.InvalidValueException%>)CAUGHT_severity_0;\n\t}\n\tfinal /*@Thrown\052/ boolean le = <%org.eclipse.ocl.pivot.library.oclany.OclComparableLessThanEqualOperation%>.INSTANCE.evaluate(executor, CAUGHT_severity_0, <%org.eclipse.qvtd.pivot.qvttemplate.QVTtemplateTables%>.INT_0).booleanValue();\n\t/*@NonInvalid\052/ boolean symbol_0;\n\tif (le) {\n\t\tsymbol_0 = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE;\n\t}\n\telse {\n\t\t@SuppressWarnings(\"null\")\n\t\tfinal /*@NonInvalid\052/ <%java.util.<%@<%org.eclipse.jdt.annotation.NonNull%> %>List%><<%org.eclipse.qvtd.pivot.qvttemplate.PropertyTemplateItem%>> part = this.getPart();\n\t\tfinal /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.values.<%@<%org.eclipse.jdt.annotation.NonNull%> %>SetValue%> BOXED_part = idResolver.createSetOfAll(<%org.eclipse.qvtd.pivot.qvttemplate.QVTtemplateTables%>.SET_CLSSid_PropertyTemplateItem, part);\n\t\t/*@Thrown\052/ <%org.eclipse.ocl.pivot.values.SetValue.<%@<%org.eclipse.jdt.annotation.NonNull%> %>Accumulator%> accumulator = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.createSetAccumulatorValue(<%org.eclipse.qvtd.pivot.qvttemplate.QVTtemplateTables%>.SET_CLSSid_PropertyTemplateItem);\n\t\t<%java.util.<%@<%org.eclipse.jdt.annotation.NonNull%> %>Iterator%><<%java.lang.Object%>> ITERATOR__1 = BOXED_part.iterator();\n\t\t/*@NonInvalid\052/ boolean result;\n\t\twhile (true) {\n\t\t\tif (!ITERATOR__1.hasNext()) {\n\t\t\t\tresult = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t@SuppressWarnings(\"null\")\n\t\t\t/*@NonInvalid\052/ <%org.eclipse.qvtd.pivot.qvttemplate.<%@<%org.eclipse.jdt.annotation.NonNull%> %>PropertyTemplateItem%> _1 = (<%org.eclipse.qvtd.pivot.qvttemplate.<%@<%org.eclipse.jdt.annotation.NonNull%> %>PropertyTemplateItem%>)ITERATOR__1.next();\n\t\t\t/**\n\t\t\t * resolvedProperty\n\t\t\t \052/\n\t\t\t@SuppressWarnings(\"null\")\n\t\t\tfinal /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.<%@<%org.eclipse.jdt.annotation.NonNull%> %>Property%> resolvedProperty = _1.getResolvedProperty();\n\t\t\t//\n\t\t\tif (accumulator.includes(resolvedProperty) == <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE) {\n\t\t\t\tresult = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.FALSE_VALUE;\t\t\t// Abort after second find\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse {\n\t\t\t\taccumulator.add(resolvedProperty);\n\t\t\t}\n\t\t}\n\t\tfinal /*@NonInvalid\052/ boolean logDiagnostic = <%org.eclipse.ocl.pivot.library.string.CGStringLogDiagnosticOperation%>.INSTANCE.evaluate(executor, <%org.eclipse.ocl.pivot.ids.TypeId%>.BOOLEAN, constraintName, this, (Object)null, diagnostics, context, (Object)null, CAUGHT_severity_0, result, <%org.eclipse.qvtd.pivot.qvttemplate.QVTtemplateTables%>.INT_0).booleanValue();\n\t\tsymbol_0 = logDiagnostic;\n\t}\n\treturn Boolean.TRUE == symbol_0;\n}\ncatch (<%java.lang.Throwable%> e) {\n\treturn <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.validationFailedDiagnostic(constraintName, this, diagnostics, context, e);\n}'"
* @generated
*/
boolean validatePartPropertyIsUnique(DiagnosticChain diagnostics, Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @model annotation="http://www.eclipse.org/uml2/2.0.0/UML originalName='TypeisObjectType'"
* annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot body='\n\ttype = referredClass\n\n'"
* annotation="http://www.eclipse.org/emf/2002/GenModel body='final <%java.lang.<%@<%org.eclipse.jdt.annotation.NonNull%> %>String%> constraintName = \"ObjectTemplateExp::TypeisObjectType\";\ntry {\n\t/**\n\t *\n\t * inv TypeisObjectType:\n\t * let severity : Integer[1] = constraintName.getSeverity()\n\t * in\n\t * if severity <= 0\n\t * then true\n\t * else\n\t * let result : Boolean[1] = type = referredClass\n\t * in\n\t * constraintName.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0)\n\t * endif\n\t \052/\n\tfinal /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.evaluation.<%@<%org.eclipse.jdt.annotation.NonNull%> %>Executor%> executor = <%org.eclipse.ocl.pivot.utilities.PivotUtil%>.getExecutor(this, context);\n\t/*@Caught\052/ <%<%@<%org.eclipse.jdt.annotation.NonNull%> %>Object%> CAUGHT_severity_0;\n\ttry {\n\t\tfinal /*@Thrown\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.qvttemplate.QVTtemplatePackage%>.Literals.OBJECT_TEMPLATE_EXP___VALIDATE_TYPEIS_OBJECT_TYPE__DIAGNOSTICCHAIN_MAP);\n\t\tCAUGHT_severity_0 = severity_0;\n\t}\n\tcatch (<%java.lang.Exception%> e) {\n\t\tCAUGHT_severity_0 = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.createInvalidValue(e);\n\t}\n\tif (CAUGHT_severity_0 instanceof <%org.eclipse.ocl.pivot.values.InvalidValueException%>) {\n\t\tthrow (<%org.eclipse.ocl.pivot.values.InvalidValueException%>)CAUGHT_severity_0;\n\t}\n\tfinal /*@Thrown\052/ boolean le = <%org.eclipse.ocl.pivot.library.oclany.OclComparableLessThanEqualOperation%>.INSTANCE.evaluate(executor, CAUGHT_severity_0, <%org.eclipse.qvtd.pivot.qvttemplate.QVTtemplateTables%>.INT_0).booleanValue();\n\t/*@NonInvalid\052/ boolean symbol_0;\n\tif (le) {\n\t\tsymbol_0 = <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.TRUE_VALUE;\n\t}\n\telse {\n\t\tfinal /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.<%@<%org.eclipse.jdt.annotation.Nullable%> %>Type%> type = this.getType();\n\t\t@SuppressWarnings(\"null\")\n\t\tfinal /*@NonInvalid\052/ <%org.eclipse.ocl.pivot.<%@<%org.eclipse.jdt.annotation.NonNull%> %>Class%> referredClass = this.getReferredClass();\n\t\tfinal /*@NonInvalid\052/ boolean result = (type != null) ? (type.getTypeId() == referredClass.getTypeId()) : false;\n\t\tfinal /*@NonInvalid\052/ boolean logDiagnostic = <%org.eclipse.ocl.pivot.library.string.CGStringLogDiagnosticOperation%>.INSTANCE.evaluate(executor, <%org.eclipse.ocl.pivot.ids.TypeId%>.BOOLEAN, constraintName, this, (Object)null, diagnostics, context, (Object)null, CAUGHT_severity_0, result, <%org.eclipse.qvtd.pivot.qvttemplate.QVTtemplateTables%>.INT_0).booleanValue();\n\t\tsymbol_0 = logDiagnostic;\n\t}\n\treturn Boolean.TRUE == symbol_0;\n}\ncatch (<%java.lang.Throwable%> e) {\n\treturn <%org.eclipse.ocl.pivot.utilities.ValueUtil%>.validationFailedDiagnostic(constraintName, this, diagnostics, context, e);\n}'"
* @generated
*/
boolean validateTypeisObjectType(DiagnosticChain diagnostics, Map<Object, Object> context);
} // ObjectTemplateExp
|