Skip to content

Instantly share code, notes, and snippets.

@xseignard
Created September 30, 2011 10:13
Show Gist options
  • Save xseignard/1253348 to your computer and use it in GitHub Desktop.
Save xseignard/1253348 to your computer and use it in GitHub Desktop.
My.ecore
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="test"
nsURI="URItest" nsPrefix="test">
<eClassifiers xsi:type="ecore:EClass" name="Truc">
<eOperations name="getAllMachins" upperBound="-1" eType="#//Machin">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="EList&lt;Machin> machins = new &lt;%org.eclipse.emf.common.util.BasicEList%>&lt;Machin>(this.getAutresMachins());&#xA;machins.add(0, this.getPremierMachin());&#xA;return machins;"/>
<details key="documentation" value="test"/>
</eAnnotations>
</eOperations>
<eStructuralFeatures xsi:type="ecore:EReference" name="premierMachin" lowerBound="1"
eType="#//Machin"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="autresMachins" lowerBound="1"
upperBound="-1" eType="#//Machin"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Machin">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
iD="true"/>
</eClassifiers>
</ecore:EPackage>
@xseignard
Copy link
Author

Small example of metamodel with method implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment