diff options
author | atikhomirov | 2006-03-23 17:04:22 +0000 |
---|---|---|
committer | atikhomirov | 2006-03-23 17:04:22 +0000 |
commit | 93f4e753a14452d7a281bc5af1a84941f564d36d (patch) | |
tree | 0f8b2e80e5b6beb7e24924333b385a901655a81d | |
parent | 470572c061cb78d25213ae981617a2c26ab978ab (diff) | |
download | org.eclipse.gmf-tooling-93f4e753a14452d7a281bc5af1a84941f564d36d.tar.gz org.eclipse.gmf-tooling-93f4e753a14452d7a281bc5af1a84941f564d36d.tar.xz org.eclipse.gmf-tooling-93f4e753a14452d7a281bc5af1a84941f564d36d.zip |
[rdvorak] #131546 Update constraint annotations in gmfgen meta-model to the latest changes
18 files changed, 210 insertions, 61 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/models/gmfgen.ecore b/plugins/org.eclipse.gmf.codegen/models/gmfgen.ecore index 2b14d1ee7..3cbe8c214 100644 --- a/plugins/org.eclipse.gmf.codegen/models/gmfgen.ecore +++ b/plugins/org.eclipse.gmf.codegen/models/gmfgen.ecore @@ -64,7 +64,8 @@ </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="GenDiagram" eSuperTypes="#//GenContainerBase #//PackageNames #//ProviderClassNames #//LinkConstraints #//EditPartCandies #//EditorCandies #//Shortcuts #//BatchValidation #//MeasurementUnit"> <eAnnotations source="http://www.eclipse.org/gmf/2005/constraints"> - <details key="ocl" value="nodes->forAll(n : GenNode | self.links->forAll(l : GenLink | l.oclAsType(TypeLinkModelFacet).metaClass <> n.getDomainMetaClass()))"/> + <details key="ocl" value="notation::Diagram.oclAsType(ecore::EClass).isSuperTypeOf(diagramRunTimeClass.ecoreClass)"/> + <details key="description" value="'Diagram Runtime Class' must be a notation::Diagram or sub-class"/> </eAnnotations> <eOperations name="getAllNodes" upperBound="-1" eType="#//GenNode"/> <eOperations name="getAllChildContainers" upperBound="-1" eType="#//GenChildContainer"/> @@ -345,6 +346,10 @@ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> <details key="documentation" value="way to decide which editpart to use for specific diagram element. Maps to attribute in DRT."/> </eAnnotations> + <eAnnotations source="http://www.eclipse.org/gmf/2005/constraints"> + <details key="ocl" value="visualID >= 0"/> + <details key="description" value="Visual ID must be a non-negative integer"/> + </eAnnotations> </eStructuralFeatures> <eStructuralFeatures xsi:type="ecore:EAttribute" name="editPartClassName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="itemSemanticEditPolicyClassName" @@ -375,13 +380,12 @@ <details key="documentation" value="EClass mapped to Node"/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/gmf/2005/constraints"> - <details key="ocl" value="let c: ecore::EClass = diagramRunTimeClass.ecoreClass.oclAsType(ecore::EClass) in c = notation::Node or c.eAllSuperTypes->includes(notation::Node)"/> + <details key="ocl" value="notation::Node.oclAsType(ecore::EClass).isSuperTypeOf(diagramRunTimeClass.ecoreClass)"/> + <details key="description" value="Node 'Diagram Runtime Class' must be a notation::Node or sub-class"/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/gmf/2005/constraints"> - <details key="ocl" value="containers->forAll(n|n.listLayout) or containers->forAll(n|not n.listLayout)"/> - </eAnnotations> - <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> - <details key="documentation" value="super.diagramRunTimeClass - diagramrt.DiagramNode or its subclass"/> + <details key="ocl" value="childNodes->forAll(n|n.modelFacet.containmentMetaFeature.genClass.ecoreClass.isSuperTypeOf(self.getDomainMetaClass().ecoreClass))"/> + <details key="description" value="Node contains child nodes with 'Containment Feature' not available in the node 'Domain Element'"/> </eAnnotations> <eOperations name="getDomainMetaClass" lowerBound="1" eType="ecore:EClass ../../../plugin/org.eclipse.emf.codegen.ecore/model/GenModel.ecore#//GenClass"> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> @@ -404,19 +408,36 @@ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="GenTopLevelNode" eSuperTypes="#//GenNode"> + <eAnnotations source="http://www.eclipse.org/gmf/2005/constraints"> + <details key="ocl" value="not modelFacet.containmentMetaFeature.oclIsUndefined() implies modelFacet.containmentMetaFeature.genClass.ecoreClass.isSuperTypeOf(diagram.domainDiagramElement.ecoreClass)"/> + <details key="description" value="Top level node 'Containment Feature' must be available in the diagram 'Domain Element' or its super-class"/> + </eAnnotations> <eStructuralFeatures xsi:type="ecore:EReference" name="diagram" lowerBound="1" eType="#//GenDiagram" changeable="false" eOpposite="#//GenDiagram/topLevelNodes"/> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="GenChildNode" eSuperTypes="#//GenNode"> + <eAnnotations source="http://www.eclipse.org/gmf/2005/constraints"> + <details key="ocl" value="not modelFacet.containmentMetaFeature.oclIsUndefined()"/> + <details key="description" value="Child node must specify 'Containment Meta Feature'"/> + </eAnnotations> <eStructuralFeatures xsi:type="ecore:EReference" name="diagram" lowerBound="1" eType="#//GenDiagram" changeable="false" eOpposite="#//GenDiagram/childNodes"/> <eStructuralFeatures xsi:type="ecore:EReference" name="containers" upperBound="-1" - eType="#//GenChildContainer" changeable="false" eOpposite="#//GenChildContainer/childNodes"/> + eType="#//GenChildContainer" changeable="false" eOpposite="#//GenChildContainer/childNodes"> + <eAnnotations source="http://www.eclipse.org/gmf/2005/constraints"> + <details key="ocl" value="containers->forAll(n|n.listLayout) or containers->forAll(n|not n.listLayout)"/> + <details key="description" value="Node is referenced from multiple containers with different 'List Layout' value"/> + </eAnnotations> + </eStructuralFeatures> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="GenCompartment" eSuperTypes="#//GenChildContainer"> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> <details key="documentation" value="Child container within node. Compartment, iow."/> </eAnnotations> + <eAnnotations source="http://www.eclipse.org/gmf/2005/constraints"> + <details key="ocl" value="childNodes->forAll(n|n.modelFacet.containmentMetaFeature.genClass.ecoreClass.isSuperTypeOf(node.getDomainMetaClass().ecoreClass))"/> + <details key="description" value="Compartment contains child nodes with 'Containment Feature' not available in the compartment containing node 'Domain Element'"/> + </eAnnotations> <eOperations name="getSemanticHintFieldName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="title" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="canCollapse" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" @@ -432,7 +453,8 @@ </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="GenLink" eSuperTypes="#//GenCommonBase"> <eAnnotations source="http://www.eclipse.org/gmf/2005/constraints"> - <details key="ocl" value="let c: ecore::EClass = diagramRunTimeClass.ecoreClass.oclAsType(ecore::EClass) in c = notation::Edge or c.eAllSuperTypes->includes(notation::Edge)"/> + <details key="ocl" value="notation::Edge.oclAsType(ecore::EClass).isSuperTypeOf(diagramRunTimeClass.ecoreClass)"/> + <details key="description" value="Link 'Diagram Runtime Class' must be a notation::Edge or sub-class"/> </eAnnotations> <eOperations name="getSources" upperBound="-1" eType="#//GenCommonBase"> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> @@ -498,7 +520,8 @@ <details key="documentation" value="Label within node"/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/gmf/2005/constraints"> - <details key="ocl" value="modelFacet.metaFeature.ecoreFeature.eContainingClass.isSuperTypeOf(node.getDomainMetaClass().ecoreClass)"/> + <details key="ocl" value="getMetaFeatures()->forAll(f|f.ecoreFeature.eContainingClass.isSuperTypeOf(node.getDomainMetaClass().ecoreClass))"/> + <details key="description" value="Node label meta features must be owned by the node 'Meta Class' or its super-classes"/> </eAnnotations> <eStructuralFeatures xsi:type="ecore:EReference" name="node" lowerBound="1" eType="#//GenNode" eOpposite="#//GenNode/labels"/> @@ -513,7 +536,12 @@ <details key="documentation" value="Label attached to link"/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/gmf/2005/constraints"> - <details key="ocl" value="let tl: TypeLinkModelFacet = link.modelFacet.oclAsType(TypeLinkModelFacet) in tl.oclIsUndefined() or modelFacet.metaFeature.ecoreFeature.eContainingClass.isSuperTypeOf(tl.metaClass.ecoreClass)"/> + <details key="ocl" value="(modelFacet.oclIsTypeOf(FeatureLabelModelFacet) or modelFacet.oclIsTypeOf(CompositeFeatureLabelModelFacet))=true implies link.modelFacet.oclIsTypeOf(TypeLinkModelFacet)"/> + <details key="description" value="Feature based link labels can only be used on link with class (TypeLinkModelFacet)"/> + </eAnnotations> + <eAnnotations source="http://www.eclipse.org/gmf/2005/constraints"> + <details key="ocl" value="let tl: TypeLinkModelFacet = link.modelFacet.oclAsType(TypeLinkModelFacet) in not tl.oclIsUndefined() implies self.getMetaFeatures()->forAll(f|f.ecoreFeature.eContainingClass.isSuperTypeOf(tl.metaClass.ecoreClass))"/> + <details key="description" value="Link label meta features must be owned by the node 'Meta Class' or its super-classes"/> </eAnnotations> <eStructuralFeatures xsi:type="ecore:EReference" name="link" lowerBound="1" eType="#//GenLink" eOpposite="#//GenLink/labels"/> @@ -555,16 +583,18 @@ <eStructuralFeatures xsi:type="ecore:EReference" name="containmentMetaFeature" eType="ecore:EClass ../../../plugin/org.eclipse.emf.codegen.ecore/model/GenModel.ecore#//GenFeature"> <eAnnotations source="http://www.eclipse.org/gmf/2005/constraints"> - <details key="ocl" value="containmentMetaFeature.ecoreFeature.oclAsType(ecore::EReference).containment"/> - </eAnnotations> - <eAnnotations source="http://www.eclipse.org/gmf/2005/constraints"> - <details key="ocl" value="containmentMetaFeature.ecoreFeature.oclAsType(ecore::EReference).eReferenceType.isSuperTypeOf(metaClass.ecoreClass)"/> + <details key="ocl" value="let r: ecore::EReference=containmentMetaFeature.ecoreFeature.oclAsType(ecore::EReference) in not containmentMetaFeature.oclIsUndefined() implies r.containment or r.eReferenceType.isSuperTypeOf(metaClass.ecoreClass)"/> + <details key="description" value="'Containment Meta Feature' must reference 'Meta Class' or its super-classes"/> </eAnnotations> </eStructuralFeatures> <eStructuralFeatures xsi:type="ecore:EReference" name="childMetaFeature" eType="ecore:EClass ../../../plugin/org.eclipse.emf.codegen.ecore/model/GenModel.ecore#//GenFeature"> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> <details key="documentation" value="Usually the same as containmentMetaFeature, unless you need to distinguish where to put and where to get from"/> </eAnnotations> + <eAnnotations source="http://www.eclipse.org/gmf/2005/constraints"> + <details key="ocl" value="not childMetaFeature.oclIsUndefined() implies childMetaFeature.ecoreFeature.oclAsType(ecore::EReference).eReferenceType.isSuperTypeOf(metaClass.ecoreClass)"/> + <details key="description" value="'Child Meta Feature' must reference 'Meta Class' or its sub-classes"/> + </eAnnotations> </eStructuralFeatures> <eStructuralFeatures xsi:type="ecore:EReference" name="modelElementSelector" eType="#//GenConstraint" containment="true"> @@ -601,18 +631,24 @@ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> <details key="documentation" value="Model facet of an EClass that associates two EClasses"/> </eAnnotations> + <eAnnotations source="http://www.eclipse.org/gmf/2005/constraints"> + <details key="ocl" value="not containmentMetaFeature.oclIsUndefined()"/> + <details key="description" value="Link 'Containment Meta Feature' must be specified"/> + </eAnnotations> <eStructuralFeatures xsi:type="ecore:EReference" name="sourceMetaFeature" eType="ecore:EClass ../../../plugin/org.eclipse.emf.codegen.ecore/model/GenModel.ecore#//GenFeature"> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> <details key="documentation" value="If source feature is not specified then link container is a link source"/> </eAnnotations> <eAnnotations source="http://www.eclipse.org/gmf/2005/constraints"> - <details key="ocl" value="sourceMetaFeature.oclIsUndefined() or sourceMetaFeature.ecoreFeature.oclAsType(ecore::EReference).eReferenceType.isSuperTypeOf(metaClass.ecoreClass)"/> + <details key="ocl" value="not sourceMetaFeature.oclIsUndefined() implies sourceMetaFeature.genClass.ecoreClass.isSuperTypeOf(metaClass.ecoreClass)"/> + <details key="description" value="Link 'Source Meta Feature' must be owned by link 'Meta Class' or its super-class"/> </eAnnotations> </eStructuralFeatures> <eStructuralFeatures xsi:type="ecore:EReference" name="targetMetaFeature" lowerBound="1" eType="ecore:EClass ../../../plugin/org.eclipse.emf.codegen.ecore/model/GenModel.ecore#//GenFeature"> <eAnnotations source="http://www.eclipse.org/gmf/2005/constraints"> - <details key="ocl" value="targetMetaFeature.genClass.ecoreClass.isSuperTypeOf(metaClass.ecoreClass)"/> + <details key="ocl" value="not targetMetaFeature.oclIsUndefined() implies targetMetaFeature.genClass.ecoreClass.isSuperTypeOf(metaClass.ecoreClass)"/> + <details key="description" value="Link 'Target Meta Feature' must be owned by link 'Meta Class' or its super-class"/> </eAnnotations> </eStructuralFeatures> </eClassifiers> @@ -819,6 +855,7 @@ </eAnnotations> <eAnnotations source="http://www.eclipse.org/gmf/2005/constraints"> <details key="ocl" value="initializers.feature->forAll(f| f.ecoreFeature.eContainingClass.isSuperTypeOf(typeModelFacet.metaClass.ecoreClass))"/> + <details key="description" value="All initializer features must be available in initialized element 'Meta Class'"/> </eAnnotations> </eStructuralFeatures> </eClassifiers> @@ -851,6 +888,7 @@ </eAnnotations> <eAnnotations source="http://www.eclipse.org/gmf/2005/constraints"> <details key="ocl" value="not sourceEnd.oclIsUndefined() or not targetEnd.oclIsUndefined()"/> + <details key="description" value="Either 'sourceEnd' or 'targetEnd' constraint must be specified"/> </eAnnotations> <eOperations name="getLinkClass" eType="ecore:EClass ../../../plugin/org.eclipse.emf.codegen.ecore/model/GenModel.ecore#//GenClass"> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> @@ -1007,6 +1045,10 @@ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> <details key="documentation" value="Unique identifier of this audit rule"/> </eAnnotations> + <eAnnotations source="http://www.eclipse.org/gmf/2005/constraints"> + <details key="ocl" value="not id.oclIsUndefined() implies container.audits->one(i | i.id = self.id)"/> + <details key="description" value="Audit rule with the same ID already exists"/> + </eAnnotations> </eStructuralFeatures> <eStructuralFeatures xsi:type="ecore:EReference" name="rule" lowerBound="1" eType="#//GenConstraint" containment="true"> @@ -1015,7 +1057,7 @@ </eAnnotations> <eAnnotations source="http://www.eclipse.org/gmf/2005/constraints/meta"> <details key="def" value="context"/> - <details key="ocl" value="target.ecoreClass"/> + <details key="ocl" value="target.getContext()"/> </eAnnotations> </eStructuralFeatures> <eStructuralFeatures xsi:type="ecore:EReference" name="target" lowerBound="1" @@ -1094,6 +1136,10 @@ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> <details key="documentation" value="Targeted diagram notation model element"/> </eAnnotations> + <eAnnotations source="http://www.eclipse.org/gmf/2005/constraints"> + <details key="ocl" value="notation::View.oclAsType(ecore::EClass).isSuperTypeOf(element.ecoreClass)"/> + <details key="description" value="Notation model element expected"/> + </eAnnotations> </eStructuralFeatures> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="GenMetricContainer" eSuperTypes="#//GenRuleContainerBase"> @@ -1105,6 +1151,10 @@ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> <details key="documentation" value="Unique key identifying this metric an abbreviation for this metric"/> </eAnnotations> + <eAnnotations source="http://www.eclipse.org/gmf/2005/constraints"> + <details key="ocl" value="not key.oclIsUndefined() implies container.metrics->one(i | i.key = self.key)"/> + <details key="description" value="Metric rule with the same 'key' already exists"/> + </eAnnotations> </eStructuralFeatures> <eStructuralFeatures xsi:type="ecore:EReference" name="rule" lowerBound="1" eType="#//ValueExpression" containment="true"> @@ -1115,6 +1165,10 @@ <details key="def" value="context"/> <details key="ocl" value="target.getContext()"/> </eAnnotations> + <eAnnotations source="http://www.eclipse.org/gmf/2005/constraints/meta"> + <details key="def" value="type"/> + <details key="ocl" value="'ecore::EDoubleObject'"/> + </eAnnotations> </eStructuralFeatures> <eStructuralFeatures xsi:type="ecore:EReference" name="target" lowerBound="1" eType="#//GenMeasurable" containment="true"> diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenAuditRule.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenAuditRule.java index 3c55d31bf..36569b548 100644 --- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenAuditRule.java +++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenAuditRule.java @@ -49,6 +49,7 @@ public interface GenAuditRule extends GenRuleBase { * @see #setId(String) * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenAuditRule_Id() * @model required="true" + * annotation="http://www.eclipse.org/gmf/2005/constraints ocl='not id.oclIsUndefined() implies container.audits->one(i | i.id = self.id)' description='Audit rule with the same ID already exists'" * @generated */ String getId(); @@ -103,7 +104,7 @@ public interface GenAuditRule extends GenRuleBase { * @see #setRule(GenConstraint) * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenAuditRule_Rule() * @model containment="true" required="true" - * annotation="http://www.eclipse.org/gmf/2005/constraints/meta def='context' ocl='target.ecoreClass'" + * annotation="http://www.eclipse.org/gmf/2005/constraints/meta def='context' ocl='target.getContext()'" * @generated */ GenConstraint getRule(); diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenChildNode.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenChildNode.java index f872d891d..a9ec70158 100644 --- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenChildNode.java +++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenChildNode.java @@ -23,7 +23,7 @@ import org.eclipse.emf.common.util.EList; * </p> * * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenChildNode() - * @model + * @model annotation="http://www.eclipse.org/gmf/2005/constraints ocl='not modelFacet.containmentMetaFeature.oclIsUndefined()' description='Child node must specify \'Containment Meta Feature\''" * @generated */ public interface GenChildNode extends GenNode { @@ -58,6 +58,7 @@ public interface GenChildNode extends GenNode { * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenChildNode_Containers() * @see org.eclipse.gmf.codegen.gmfgen.GenChildContainer#getChildNodes * @model type="org.eclipse.gmf.codegen.gmfgen.GenChildContainer" opposite="childNodes" changeable="false" + * annotation="http://www.eclipse.org/gmf/2005/constraints ocl='containers->forAll(n|n.listLayout) or containers->forAll(n|not n.listLayout)' description='Node is referenced from multiple containers with different \'List Layout\' value'" * @generated */ EList getContainers(); diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenCommonBase.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenCommonBase.java index 816da8f81..b7fccb8c4 100644 --- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenCommonBase.java +++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenCommonBase.java @@ -72,6 +72,7 @@ public interface GenCommonBase extends EObject { * @see #setVisualID(int) * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenCommonBase_VisualID() * @model required="true" + * annotation="http://www.eclipse.org/gmf/2005/constraints ocl='visualID >= 0' description='Visual ID must be a non-negative integer'" * @generated */ int getVisualID(); diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenCompartment.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenCompartment.java index a92c39074..18e28138e 100644 --- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenCompartment.java +++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenCompartment.java @@ -30,7 +30,7 @@ package org.eclipse.gmf.codegen.gmfgen; * </p> * * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenCompartment() - * @model + * @model annotation="http://www.eclipse.org/gmf/2005/constraints ocl='childNodes->forAll(n|n.modelFacet.containmentMetaFeature.genClass.ecoreClass.isSuperTypeOf(node.getDomainMetaClass().ecoreClass))' description='Compartment contains child nodes with \'Containment Feature\' not available in the compartment containing node \'Domain Element\''" * @generated */ public interface GenCompartment extends GenChildContainer { diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenDiagram.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenDiagram.java index 346b18cfe..c5842995e 100644 --- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenDiagram.java +++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenDiagram.java @@ -29,7 +29,7 @@ import org.eclipse.gmf.common.codegen.ImportAssistant; * </p> * * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenDiagram() - * @model annotation="http://www.eclipse.org/gmf/2005/constraints ocl='nodes->forAll(n : GenNode | self.links->forAll(l : GenLink | l.oclAsType(TypeLinkModelFacet).metaClass <> n.getDomainMetaClass()))'" + * @model annotation="http://www.eclipse.org/gmf/2005/constraints ocl='notation::Diagram.oclAsType(ecore::EClass).isSuperTypeOf(diagramRunTimeClass.ecoreClass)' description='\'Diagram Runtime Class\' must be a notation::Diagram or sub-class'" * @generated */ public interface GenDiagram extends GenContainerBase, PackageNames, ProviderClassNames, LinkConstraints, EditPartCandies, EditorCandies, Shortcuts, BatchValidation, MeasurementUnit { diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenFeatureSeqInitializer.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenFeatureSeqInitializer.java index dc4b9e26c..2259a9aaa 100644 --- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenFeatureSeqInitializer.java +++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenFeatureSeqInitializer.java @@ -41,7 +41,7 @@ public interface GenFeatureSeqInitializer extends GenElementInitializer { * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenFeatureSeqInitializer_Initializers() * @model type="org.eclipse.gmf.codegen.gmfgen.GenFeatureValueSpec" containment="true" required="true" * annotation="http://www.eclipse.org/gmf/2005/constraints/meta def='context' ocl='typeModelFacet.metaClass.ecoreClass'" - * annotation="http://www.eclipse.org/gmf/2005/constraints ocl='initializers.feature->forAll(f| f.ecoreFeature.eContainingClass.isSuperTypeOf(typeModelFacet.metaClass.ecoreClass))'" + * annotation="http://www.eclipse.org/gmf/2005/constraints ocl='initializers.feature->forAll(f| f.ecoreFeature.eContainingClass.isSuperTypeOf(typeModelFacet.metaClass.ecoreClass))' description='All initializer features must be available in initialized element \'Meta Class\''" * @generated */ EList getInitializers(); diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenLink.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenLink.java index 68cfeac83..380101374 100644 --- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenLink.java +++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenLink.java @@ -27,7 +27,7 @@ import org.eclipse.emf.common.util.EList; * </p> * * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenLink() - * @model annotation="http://www.eclipse.org/gmf/2005/constraints ocl='let c: ecore::EClass = diagramRunTimeClass.ecoreClass.oclAsType(ecore::EClass) in c = notation::Edge or c.eAllSuperTypes->includes(notation::Edge)'" + * @model annotation="http://www.eclipse.org/gmf/2005/constraints ocl='notation::Edge.oclAsType(ecore::EClass).isSuperTypeOf(diagramRunTimeClass.ecoreClass)' description='Link \'Diagram Runtime Class\' must be a notation::Edge or sub-class'" * @generated */ public interface GenLink extends GenCommonBase { diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenLinkConstraints.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenLinkConstraints.java index e1eabc78a..ae9a727ec 100644 --- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenLinkConstraints.java +++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenLinkConstraints.java @@ -29,7 +29,7 @@ import org.eclipse.emf.ecore.EObject; * </p> * * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenLinkConstraints() - * @model annotation="http://www.eclipse.org/gmf/2005/constraints ocl='not sourceEnd.oclIsUndefined() or not targetEnd.oclIsUndefined()'" + * @model annotation="http://www.eclipse.org/gmf/2005/constraints ocl='not sourceEnd.oclIsUndefined() or not targetEnd.oclIsUndefined()' description='Either \'sourceEnd\' or \'targetEnd\' constraint must be specified'" * @generated */ public interface GenLinkConstraints extends EObject { diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenLinkLabel.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenLinkLabel.java index fdc6c1976..3963b7205 100644 --- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenLinkLabel.java +++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenLinkLabel.java @@ -25,7 +25,8 @@ package org.eclipse.gmf.codegen.gmfgen; * </p> * * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenLinkLabel() - * @model annotation="http://www.eclipse.org/gmf/2005/constraints ocl='let tl: TypeLinkModelFacet = link.modelFacet.oclAsType(TypeLinkModelFacet) in tl.oclIsUndefined() or modelFacet.metaFeature.ecoreFeature.eContainingClass.isSuperTypeOf(tl.metaClass.ecoreClass)'" + * @model annotation="http://www.eclipse.org/gmf/2005/constraints ocl='(modelFacet.oclIsTypeOf(FeatureLabelModelFacet) or modelFacet.oclIsTypeOf(CompositeFeatureLabelModelFacet))=true implies link.modelFacet.oclIsTypeOf(TypeLinkModelFacet)' description='Feature based link labels can only be used on link with class (TypeLinkModelFacet)'" + * annotation="http://www.eclipse.org/gmf/2005/constraints ocl='let tl: TypeLinkModelFacet = link.modelFacet.oclAsType(TypeLinkModelFacet) in not tl.oclIsUndefined() implies self.getMetaFeatures()->forAll(f|f.ecoreFeature.eContainingClass.isSuperTypeOf(tl.metaClass.ecoreClass))' description='Link label meta features must be owned by the node \'Meta Class\' or its super-classes'" * @generated */ public interface GenLinkLabel extends GenLabel { diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenMetricRule.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenMetricRule.java index 06ceb90e9..67bb2ee45 100644 --- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenMetricRule.java +++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenMetricRule.java @@ -38,6 +38,7 @@ public interface GenMetricRule extends GenRuleBase { * @see #setKey(String) * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenMetricRule_Key() * @model required="true" + * annotation="http://www.eclipse.org/gmf/2005/constraints ocl='not key.oclIsUndefined() implies container.metrics->one(i | i.key = self.key)' description='Metric rule with the same \'key\' already exists'" * @generated */ String getKey(); @@ -64,6 +65,7 @@ public interface GenMetricRule extends GenRuleBase { * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenMetricRule_Rule() * @model containment="true" required="true" * annotation="http://www.eclipse.org/gmf/2005/constraints/meta def='context' ocl='target.getContext()'" + * annotation="http://www.eclipse.org/gmf/2005/constraints/meta def='type' ocl='\'ecore::EDoubleObject\''" * @generated */ ValueExpression getRule(); diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenNode.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenNode.java index 4fa5b1de8..5aa884548 100644 --- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenNode.java +++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenNode.java @@ -30,8 +30,8 @@ import org.eclipse.emf.common.util.EList; * * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenNode() * @model abstract="true" - * annotation="http://www.eclipse.org/gmf/2005/constraints ocl='let c: ecore::EClass = diagramRunTimeClass.ecoreClass.oclAsType(ecore::EClass) in c = notation::Node or c.eAllSuperTypes->includes(notation::Node)'" - * annotation="http://www.eclipse.org/gmf/2005/constraints ocl='containers->forAll(n|n.listLayout) or containers->forAll(n|not n.listLayout)'" + * annotation="http://www.eclipse.org/gmf/2005/constraints ocl='notation::Node.oclAsType(ecore::EClass).isSuperTypeOf(diagramRunTimeClass.ecoreClass)' description='Node \'Diagram Runtime Class\' must be a notation::Node or sub-class'" + * annotation="http://www.eclipse.org/gmf/2005/constraints ocl='childNodes->forAll(n|n.modelFacet.containmentMetaFeature.genClass.ecoreClass.isSuperTypeOf(self.getDomainMetaClass().ecoreClass))' description='Node contains child nodes with \'Containment Feature\' not available in the node \'Domain Element\''" * @generated */ public interface GenNode extends GenChildContainer { diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenNodeLabel.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenNodeLabel.java index 5e6a265dc..57300b02d 100644 --- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenNodeLabel.java +++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenNodeLabel.java @@ -24,10 +24,10 @@ package org.eclipse.gmf.codegen.gmfgen; * </p> * * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenNodeLabel() - * @model annotation="http://www.eclipse.org/gmf/2005/constraints ocl='modelFacet.metaFeature.ecoreFeature.eContainingClass.isSuperTypeOf(node.getDomainMetaClass().ecoreClass)'" + * @model annotation="http://www.eclipse.org/gmf/2005/constraints ocl='getMetaFeatures()->forAll(f|f.ecoreFeature.eContainingClass.isSuperTypeOf(node.getDomainMetaClass().ecoreClass))' description='Node label meta features must be owned by the node \'Meta Class\' or its super-classes'" * @generated */ -public interface GenNodeLabel extends GenLabel{ +public interface GenNodeLabel extends GenLabel { /** * Returns the value of the '<em><b>Node</b></em>' container reference. * It is bidirectional and its opposite is '{@link org.eclipse.gmf.codegen.gmfgen.GenNode#getLabels <em>Labels</em>}'. diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenNotationElementTarget.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenNotationElementTarget.java index c5b76b370..883b2d9c2 100644 --- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenNotationElementTarget.java +++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenNotationElementTarget.java @@ -45,6 +45,7 @@ public interface GenNotationElementTarget extends GenAuditable, GenMeasurable { * @see #setElement(GenClass) * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenNotationElementTarget_Element() * @model required="true" + * annotation="http://www.eclipse.org/gmf/2005/constraints ocl='notation::View.oclAsType(ecore::EClass).isSuperTypeOf(element.ecoreClass)' description='Notation model element expected'" * @generated */ GenClass getElement(); diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenTopLevelNode.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenTopLevelNode.java index 20fa78969..5b1d508bc 100644 --- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenTopLevelNode.java +++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenTopLevelNode.java @@ -20,7 +20,7 @@ package org.eclipse.gmf.codegen.gmfgen; * </p> * * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenTopLevelNode() - * @model + * @model annotation="http://www.eclipse.org/gmf/2005/constraints ocl='not modelFacet.containmentMetaFeature.oclIsUndefined() implies modelFacet.containmentMetaFeature.genClass.ecoreClass.isSuperTypeOf(diagram.domainDiagramElement.ecoreClass)' description='Top level node \'Containment Feature\' must be available in the diagram \'Domain Element\' or its super-class'" * @generated */ public interface GenTopLevelNode extends GenNode { diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/TypeLinkModelFacet.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/TypeLinkModelFacet.java index af670f80f..c13f1308e 100644 --- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/TypeLinkModelFacet.java +++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/TypeLinkModelFacet.java @@ -26,10 +26,10 @@ import org.eclipse.emf.codegen.ecore.genmodel.GenFeature; * </p> * * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getTypeLinkModelFacet() - * @model + * @model annotation="http://www.eclipse.org/gmf/2005/constraints ocl='not containmentMetaFeature.oclIsUndefined()' description='Link \'Containment Meta Feature\' must be specified'" * @generated */ -public interface TypeLinkModelFacet extends TypeModelFacet, LinkModelFacet{ +public interface TypeLinkModelFacet extends TypeModelFacet, LinkModelFacet { /** * Returns the value of the '<em><b>Source Meta Feature</b></em>' reference. * <!-- begin-user-doc --> @@ -44,7 +44,7 @@ public interface TypeLinkModelFacet extends TypeModelFacet, LinkModelFacet{ * @return the value of the '<em>Source Meta Feature</em>' reference. * @see #setSourceMetaFeature(GenFeature) * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getTypeLinkModelFacet_SourceMetaFeature() - * @model annotation="http://www.eclipse.org/gmf/2005/constraints ocl='sourceMetaFeature.oclIsUndefined() or sourceMetaFeature.ecoreFeature.oclAsType(ecore::EReference).eReferenceType.isSuperTypeOf(metaClass.ecoreClass)'" + * @model annotation="http://www.eclipse.org/gmf/2005/constraints ocl='not sourceMetaFeature.oclIsUndefined() implies sourceMetaFeature.genClass.ecoreClass.isSuperTypeOf(metaClass.ecoreClass)' description='Link \'Source Meta Feature\' must be owned by link \'Meta Class\' or its super-class'" * @generated */ GenFeature getSourceMetaFeature(); @@ -71,7 +71,7 @@ public interface TypeLinkModelFacet extends TypeModelFacet, LinkModelFacet{ * @see #setTargetMetaFeature(GenFeature) * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getTypeLinkModelFacet_TargetMetaFeature() * @model required="true" - * annotation="http://www.eclipse.org/gmf/2005/constraints ocl='targetMetaFeature.genClass.ecoreClass.isSuperTypeOf(metaClass.ecoreClass)'" + * annotation="http://www.eclipse.org/gmf/2005/constraints ocl='not targetMetaFeature.oclIsUndefined() implies targetMetaFeature.genClass.ecoreClass.isSuperTypeOf(metaClass.ecoreClass)' description='Link \'Target Meta Feature\' must be owned by link \'Meta Class\' or its super-class'" * @generated */ GenFeature getTargetMetaFeature(); diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/TypeModelFacet.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/TypeModelFacet.java index a38f111ad..2c3c94396 100644 --- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/TypeModelFacet.java +++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/TypeModelFacet.java @@ -71,8 +71,7 @@ public interface TypeModelFacet extends ModelFacet { * @return the value of the '<em>Containment Meta Feature</em>' reference. * @see #setContainmentMetaFeature(GenFeature) * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getTypeModelFacet_ContainmentMetaFeature() - * @model annotation="http://www.eclipse.org/gmf/2005/constraints ocl='containmentMetaFeature.ecoreFeature.oclAsType(ecore::EReference).containment'" - * annotation="http://www.eclipse.org/gmf/2005/constraints ocl='containmentMetaFeature.ecoreFeature.oclAsType(ecore::EReference).eReferenceType.isSuperTypeOf(metaClass.ecoreClass)'" + * @model annotation="http://www.eclipse.org/gmf/2005/constraints ocl='let r: ecore::EReference=containmentMetaFeature.ecoreFeature.oclAsType(ecore::EReference) in not containmentMetaFeature.oclIsUndefined() implies r.containment or r.eReferenceType.isSuperTypeOf(metaClass.ecoreClass)' description='\'Containment Meta Feature\' must reference \'Meta Class\' or its super-classes'" * @generated */ GenFeature getContainmentMetaFeature(); @@ -97,7 +96,7 @@ public interface TypeModelFacet extends ModelFacet { * @return the value of the '<em>Child Meta Feature</em>' reference. * @see #setChildMetaFeature(GenFeature) * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getTypeModelFacet_ChildMetaFeature() - * @model + * @model annotation="http://www.eclipse.org/gmf/2005/constraints ocl='not childMetaFeature.oclIsUndefined() implies childMetaFeature.ecoreFeature.oclAsType(ecore::EReference).eReferenceType.isSuperTypeOf(metaClass.ecoreClass)' description='\'Child Meta Feature\' must reference \'Meta Class\' or its sub-classes'" * @generated */ GenFeature getChildMetaFeature(); diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenPackageImpl.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenPackageImpl.java index 2c8d75ad7..8e1ea0754 100644 --- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenPackageImpl.java +++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenPackageImpl.java @@ -4117,7 +4117,7 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage { "constraints", "http://www.eclipse.org/gmf/2005/constraints", "meta", "http://www.eclipse.org/gmf/2005/constraints/meta", "deprecated", "http://www.eclipse.org/gmf/2006/deprecated" - }); + }); } /** @@ -4138,74 +4138,156 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage { (genDiagramEClass, source, new String[] { - "ocl", "nodes->forAll(n : GenNode | self.links->forAll(l : GenLink | l.oclAsType(TypeLinkModelFacet).metaClass <> n.getDomainMetaClass()))" - }); + "ocl", "notation::Diagram.oclAsType(ecore::EClass).isSuperTypeOf(diagramRunTimeClass.ecoreClass)", + "description", "\'Diagram Runtime Class\' must be a notation::Diagram or sub-class" + }); + addAnnotation + (getGenCommonBase_VisualID(), + source, + new String[] { + "ocl", "visualID >= 0", + "description", "Visual ID must be a non-negative integer" + }); addAnnotation (genNodeEClass, source, new String[] { - "ocl", "let c: ecore::EClass = diagramRunTimeClass.ecoreClass.oclAsType(ecore::EClass) in c = notation::Node or c.eAllSuperTypes->includes(notation::Node)" + "ocl", "notation::Node.oclAsType(ecore::EClass).isSuperTypeOf(diagramRunTimeClass.ecoreClass)", + "description", "Node \'Diagram Runtime Class\' must be a notation::Node or sub-class" }); addAnnotation (genNodeEClass, source, new String[] { - "ocl", "containers->forAll(n|n.listLayout) or containers->forAll(n|not n.listLayout)" - }); + "ocl", "childNodes->forAll(n|n.modelFacet.containmentMetaFeature.genClass.ecoreClass.isSuperTypeOf(self.getDomainMetaClass().ecoreClass))", + "description", "Node contains child nodes with \'Containment Feature\' not available in the node \'Domain Element\'" + }); + addAnnotation + (genTopLevelNodeEClass, + source, + new String[] { + "ocl", "not modelFacet.containmentMetaFeature.oclIsUndefined() implies modelFacet.containmentMetaFeature.genClass.ecoreClass.isSuperTypeOf(diagram.domainDiagramElement.ecoreClass)", + "description", "Top level node \'Containment Feature\' must be available in the diagram \'Domain Element\' or its super-class" + }); + addAnnotation + (genChildNodeEClass, + source, + new String[] { + "ocl", "not modelFacet.containmentMetaFeature.oclIsUndefined()", + "description", "Child node must specify \'Containment Meta Feature\'" + }); + addAnnotation + (getGenChildNode_Containers(), + source, + new String[] { + "ocl", "containers->forAll(n|n.listLayout) or containers->forAll(n|not n.listLayout)", + "description", "Node is referenced from multiple containers with different \'List Layout\' value" + }); + addAnnotation + (genCompartmentEClass, + source, + new String[] { + "ocl", "childNodes->forAll(n|n.modelFacet.containmentMetaFeature.genClass.ecoreClass.isSuperTypeOf(node.getDomainMetaClass().ecoreClass))", + "description", "Compartment contains child nodes with \'Containment Feature\' not available in the compartment containing node \'Domain Element\'" + }); addAnnotation (genLinkEClass, source, new String[] { - "ocl", "let c: ecore::EClass = diagramRunTimeClass.ecoreClass.oclAsType(ecore::EClass) in c = notation::Edge or c.eAllSuperTypes->includes(notation::Edge)" + "ocl", "notation::Edge.oclAsType(ecore::EClass).isSuperTypeOf(diagramRunTimeClass.ecoreClass)", + "description", "Link \'Diagram Runtime Class\' must be a notation::Edge or sub-class" }); addAnnotation (genNodeLabelEClass, source, new String[] { - "ocl", "modelFacet.metaFeature.ecoreFeature.eContainingClass.isSuperTypeOf(node.getDomainMetaClass().ecoreClass)" + "ocl", "getMetaFeatures()->forAll(f|f.ecoreFeature.eContainingClass.isSuperTypeOf(node.getDomainMetaClass().ecoreClass))", + "description", "Node label meta features must be owned by the node \'Meta Class\' or its super-classes" }); addAnnotation (genLinkLabelEClass, source, new String[] { - "ocl", "let tl: TypeLinkModelFacet = link.modelFacet.oclAsType(TypeLinkModelFacet) in tl.oclIsUndefined() or modelFacet.metaFeature.ecoreFeature.eContainingClass.isSuperTypeOf(tl.metaClass.ecoreClass)" + "ocl", "(modelFacet.oclIsTypeOf(FeatureLabelModelFacet) or modelFacet.oclIsTypeOf(CompositeFeatureLabelModelFacet))=true implies link.modelFacet.oclIsTypeOf(TypeLinkModelFacet)", + "description", "Feature based link labels can only be used on link with class (TypeLinkModelFacet)" + }); + addAnnotation + (genLinkLabelEClass, + source, + new String[] { + "ocl", "let tl: TypeLinkModelFacet = link.modelFacet.oclAsType(TypeLinkModelFacet) in not tl.oclIsUndefined() implies self.getMetaFeatures()->forAll(f|f.ecoreFeature.eContainingClass.isSuperTypeOf(tl.metaClass.ecoreClass))", + "description", "Link label meta features must be owned by the node \'Meta Class\' or its super-classes" }); addAnnotation (getTypeModelFacet_ContainmentMetaFeature(), source, new String[] { - "ocl", "containmentMetaFeature.ecoreFeature.oclAsType(ecore::EReference).containment" - }); + "ocl", "let r: ecore::EReference=containmentMetaFeature.ecoreFeature.oclAsType(ecore::EReference) in not containmentMetaFeature.oclIsUndefined() implies r.containment or r.eReferenceType.isSuperTypeOf(metaClass.ecoreClass)", + "description", "\'Containment Meta Feature\' must reference \'Meta Class\' or its super-classes" + }); addAnnotation - (getTypeModelFacet_ContainmentMetaFeature(), + (getTypeModelFacet_ChildMetaFeature(), source, new String[] { - "ocl", "containmentMetaFeature.ecoreFeature.oclAsType(ecore::EReference).eReferenceType.isSuperTypeOf(metaClass.ecoreClass)" - }); + "ocl", "not childMetaFeature.oclIsUndefined() implies childMetaFeature.ecoreFeature.oclAsType(ecore::EReference).eReferenceType.isSuperTypeOf(metaClass.ecoreClass)", + "description", "\'Child Meta Feature\' must reference \'Meta Class\' or its sub-classes" + }); + addAnnotation + (typeLinkModelFacetEClass, + source, + new String[] { + "ocl", "not containmentMetaFeature.oclIsUndefined()", + "description", "Link \'Containment Meta Feature\' must be specified" + }); addAnnotation (getTypeLinkModelFacet_SourceMetaFeature(), source, new String[] { - "ocl", "sourceMetaFeature.oclIsUndefined() or sourceMetaFeature.ecoreFeature.oclAsType(ecore::EReference).eReferenceType.isSuperTypeOf(metaClass.ecoreClass)" + "ocl", "not sourceMetaFeature.oclIsUndefined() implies sourceMetaFeature.genClass.ecoreClass.isSuperTypeOf(metaClass.ecoreClass)", + "description", "Link \'Source Meta Feature\' must be owned by link \'Meta Class\' or its super-class" }); addAnnotation (getTypeLinkModelFacet_TargetMetaFeature(), source, new String[] { - "ocl", "targetMetaFeature.genClass.ecoreClass.isSuperTypeOf(metaClass.ecoreClass)" + "ocl", "not targetMetaFeature.oclIsUndefined() implies targetMetaFeature.genClass.ecoreClass.isSuperTypeOf(metaClass.ecoreClass)", + "description", "Link \'Target Meta Feature\' must be owned by link \'Meta Class\' or its super-class" }); addAnnotation (getGenFeatureSeqInitializer_Initializers(), source, new String[] { - "ocl", "initializers.feature->forAll(f| f.ecoreFeature.eContainingClass.isSuperTypeOf(typeModelFacet.metaClass.ecoreClass))" + "ocl", "initializers.feature->forAll(f| f.ecoreFeature.eContainingClass.isSuperTypeOf(typeModelFacet.metaClass.ecoreClass))", + "description", "All initializer features must be available in initialized element \'Meta Class\'" }); addAnnotation (genLinkConstraintsEClass, source, new String[] { - "ocl", "not sourceEnd.oclIsUndefined() or not targetEnd.oclIsUndefined()" - }); + "ocl", "not sourceEnd.oclIsUndefined() or not targetEnd.oclIsUndefined()", + "description", "Either \'sourceEnd\' or \'targetEnd\' constraint must be specified" + }); + addAnnotation + (getGenAuditRule_Id(), + source, + new String[] { + "ocl", "not id.oclIsUndefined() implies container.audits->one(i | i.id = self.id)", + "description", "Audit rule with the same ID already exists" + }); + addAnnotation + (getGenNotationElementTarget_Element(), + source, + new String[] { + "ocl", "notation::View.oclAsType(ecore::EClass).isSuperTypeOf(element.ecoreClass)", + "description", "Notation model element expected" + }); + addAnnotation + (getGenMetricRule_Key(), + source, + new String[] { + "ocl", "not key.oclIsUndefined() implies container.metrics->one(i | i.key = self.key)", + "description", "Metric rule with the same \'key\' already exists" + }); } /** @@ -4215,14 +4297,14 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage { * @generated */ protected void createMetaAnnotations() { - String source = "http://www.eclipse.org/gmf/2005/constraints/meta"; + String source = "http://www.eclipse.org/gmf/2005/constraints/meta"; addAnnotation (getTypeModelFacet_ModelElementSelector(), source, new String[] { "def", "context", "ocl", "metaClass.ecoreClass" - }); + }); addAnnotation (valueExpressionEClass, source, @@ -4296,20 +4378,27 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage { "def", "variable", "name", "oppositeEnd", "type.ocl", "getSourceEndContextClass().ecoreClass" - }); + }); addAnnotation (getGenAuditRule_Rule(), source, new String[] { "def", "context", - "ocl", "target.ecoreClass" - }); + "ocl", "target.getContext()" + }); addAnnotation (getGenMetricRule_Rule(), source, new String[] { "def", "context", "ocl", "target.getContext()" + }); + addAnnotation + (getGenMetricRule_Rule(), + source, + new String[] { + "def", "type", + "ocl", "\'ecore::EDoubleObject\'" }); } |