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