/** Create a SarlRequiredCapacity. * @param name the types referenced by the SarlRequiredCapacity. */ public void addSarlRequiredCapacity(String... name) { if (name != null && name.length > 0) { SarlRequiredCapacity member = SarlFactory.eINSTANCE.createSarlRequiredCapacity(); this.sarlSkill.getMembers().add(member); member.setAnnotationInfo(XtendFactory.eINSTANCE.createXtendMember()); Collection<JvmParameterizedTypeReference> thecollection = member.getCapacities(); for (final String aname : name) { if (!Strings.isEmpty(aname)) { thecollection.add(newTypeRef(this.sarlSkill, aname)); } } } }
/** Create a SarlCapacityUses. * @param name the types referenced by the SarlCapacityUses. */ public void addSarlCapacityUses(String... name) { if (name != null && name.length > 0) { SarlCapacityUses member = SarlFactory.eINSTANCE.createSarlCapacityUses(); this.sarlSkill.getMembers().add(member); member.setAnnotationInfo(XtendFactory.eINSTANCE.createXtendMember()); Collection<JvmParameterizedTypeReference> thecollection = member.getCapacities(); for (final String aname : name) { if (!Strings.isEmpty(aname)) { thecollection.add(newTypeRef(this.sarlSkill, aname)); } } } }
/** Generate the given object. * * @param skill the skill. * @param context the context. */ protected void _generate(SarlSkill skill, IExtraLanguageGeneratorContext context) { final JvmDeclaredType jvmType = getJvmModelAssociations().getInferredType(skill); final PyAppendable appendable = createAppendable(jvmType, context); List<JvmTypeReference> superTypes = getSuperTypes(skill.getExtends(), skill.getImplements()); if (superTypes.isEmpty()) { superTypes = Collections.singletonList(getTypeReferences().getTypeForName(Skill.class, skill)); } final String qualifiedName = this.qualifiedNameProvider.getFullyQualifiedName(skill).toString(); if (generateTypeDeclaration( qualifiedName, skill.getName(), skill.isAbstract(), superTypes, getTypeBuilder().getDocumentation(skill), true, skill.getMembers(), appendable, context, (it, context2) -> { generateGuardEvaluators(qualifiedName, it, context2); })) { final QualifiedName name = getQualifiedNameProvider().getFullyQualifiedName(skill); writeFile(name, appendable, context); } }