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