/** Initialize the Ecore element when inner type declaration. */ public void eInit(XtendTypeDeclaration container, String name, IJvmTypeProvider context) { if (this.sarlEnumeration == null) { this.container = container; this.sarlEnumeration = SarlFactory.eINSTANCE.createSarlEnumeration(); container.getMembers().add(this.sarlEnumeration); if (!Strings.isEmpty(name)) { this.sarlEnumeration.setName(name); } } }
/** Initialize the Ecore element when inside a script. */ public void eInit(SarlScript script, String name, IJvmTypeProvider context) { setTypeResolutionContext(context); if (this.sarlEnumeration == null) { this.container = script; this.sarlEnumeration = SarlFactory.eINSTANCE.createSarlEnumeration(); script.getXtendTypes().add(this.sarlEnumeration); this.sarlEnumeration.setAnnotationInfo(XtendFactory.eINSTANCE.createXtendTypeDeclaration()); if (!Strings.isEmpty(name)) { this.sarlEnumeration.setName(name); } } }