| package test; class Foo { } |
| package p; |
| @namespace(uri="http://www.eclipse.org/emf/2002/Ecore",
prefix="ecore") package ecore; |
| package main; package sub1 { } package sub2 { package sub2_1 { } package sub2_2 { } } |
| package main; import "platform:/resource/proj1/foo.ecore"; import "http://www.eclipse.org/emf/2002/Ecore"; package sub { } |
| package main; class C1 { } // isInterface=false, isAbstract=false abstract class C2 { } // isInterface=false, isAbstract=true interface I1 { } // isInterface=true, isAbstract=false abstract interface I2 { } // isInterface=true, isAbstract=true |
| package main; class A { } class B { } class C extends A, B { } class D extends C { } |
| class EStringToStringMapEntry :
java.util.Map$Entry { // ... contents omitted ... } |
| datatype EInt : int; datatype EIntegerObject : java.lang.Integer; transient datatype EJavaObject : java.lang.Object; datatype EFeatureMapEntry : org.eclipse.emf.ecore.util.FeatureMap$Entry; datatype EByteArray : "byte[]"; // Note: [ and ] are not legal identifier characters and must be in quotes |
| enum E { A=1; B=2; C=3; } |
| enum E { A; // = 0 (if not specified, first literal has value 0) B = 3; C; // = 4 (in general, unspecified values are 1 greater than previous value) D; // = 5 } |
| mapentry EStringToStringMapEntry
: String -> String; |
| package test; datatype D1 : int; package P { datatype D2 : int; } class C { attr D1 d1; attr P.D2 d2; attr ecore.EString s1; attr String s2; } |
| Emfatic
Keyword |
Ecore
EClassifier name |
Java
type name |
| boolean |
EBoolean |
boolean |
| Boolean |
EBooleanObject |
java.lang.Boolean |
| byte |
EByte |
byte |
| Byte |
EByteObject |
java.lang.Byte |
| char |
EChar |
char |
| Character |
ECharacterObject |
java.lang.Character |
| double |
EDouble |
double |
| Double |
EDoubleObject |
java.lang.Double |
| float |
EFloat |
float |
| Float |
EFloatObject |
java.lang.Float |
| int |
EInt |
int |
| Integer |
EIntegerObject |
java.lang.Integer |
| long |
ELong |
long |
| Long |
ELongObject |
java.lang.Long |
| short |
EShort |
short |
| Short |
EShortObject |
java.lang.Short |
| Date |
EDate |
java.util.Date |
| String |
EString |
java.lang.String |
| Object |
EJavaObject |
java.lang.Object |
| Class |
EJavaClass |
java.lang.Class |
| EObject |
EObject | org.eclipse.emf.ecore.EObject |
| EClass |
EClass |
org.eclipse.emf.ecore.EClass |
| class C { attr String[1] s1; attr String[0..3] s2; attr String[*] s3; attr String[+] s4; } |
| Emfatic
multiplicity expression |
ETypedElement
lowerBound |
ETypedElement
upperBound |
| none |
0 |
1 |
| [?] |
0 |
1 |
| [] |
0 |
unbounded (-1) |
| [*] |
0 |
unbounded (-1) |
| [+] |
1 |
unbounded (-1) |
| [1] |
1 |
1 |
| [n] |
n |
n |
| [0..4] |
0 |
4 |
| [m..n] |
m |
n |
| [5..*] |
5 |
unbounded (-1) |
| [1..?] |
1 |
unspecified (-2) |
| class EClass extends EClassifier
{ // ... ~abstract : EBoolean; ~interface : EBoolean; // ... } |
| class EPackage extends
ENamedElement { op EClassifier getEClassifier(EString name); attr EString nsURI; attr EString nsPrefix; transient !resolve ref EFactory[1]#ePackage eFactoryInstance; val EClassifier[*]#ePackage eClassifiers; val EPackage[*]#eSuperPackage eSubpackages; readonly transient ref EPackage#eSubpackages eSuperPackage; } |
| Emfatic
keyword |
introduces |
| attr |
EAttribute |
| op |
EOperation |
| ref |
normal EReference
(EReference.containment = false) |
| val |
"by value" EReference
(EReference.containment = true) |
| modifier |
means |
applies
to |
| readonly |
EStructuralFeature.changeable =
false |
attribute, reference |
| volatile |
EStructuralFeature.volatile =
true |
attribute, reference |
| transient |
EStructuralFeature.transient =
true |
attribute, reference |
| unsettable |
EStructuralFeature.unsettable =
true |
attribute, reference |
| derived |
EStructuralFeature.derived = true |
attribute, reference |
| unique |
ETypedElement.unique = true |
attribute, reference, operation,
parameter |
| ordered |
ETypedElement.ordered = true |
attribute, reference, operation, parameter |
| resolve |
EReference.resolveProxies = true |
reference |
| id |
EAttribute.iD = true |
attribute |
| class X { !ordered attr String[*] s; } |
| class C { attr String s; attr int i = 1; attr ecore.EBoolean b = true; } |
| class EPackage extends
ENamedElement { // ... val EPackage[*]#eSuperPackage eSubpackages; readonly transient ref EPackage#eSubpackages eSuperPackage; } |
| class X { op String getFullName(); op void returnsNothing(); op int add(int a, int b); op EObject doSomething(int a, ecore.EBoolean b) throws ExceptionA, ExceptionB; } |
| @"http://source/uri"("key1"="value1",
"key2"="value2") @sourceLabel(key.a="value1", key.b="value2") @simpleAttr package test; @"http://class/annotation"(k="v") class C { @"http://attribute/annotation"(k="v") attr int a; op int Op( @before(k=v) int a, int b @after(k=v) ); } enum E { @"http://before"(k=v) A=1; B=2 @"http://after"(k=v); } |
| Emfatic
annotation label |
maps
to EAnnotation.source value |
| Ecore |
http://www.eclipse.org/emf/2002/Ecore |
| GenModel |
http://www.eclipse.org/emf/2002/GenModel |
| ExtendedMetaData |
http:///org/eclipse/emf/ecore/util/ExtendedMetaData |
| EmfaticAnnotationMap |
http://www.eclipse.org/emf/2004/EmfaticAnnotationMap |
| @EmfaticAnnotationMap(myLabel="http://foo/bar") @genmodel(documentation="model documentation") package test; @ecore(constraints="constraintA constraintB") @myLabel(key="value") class C { } |