/** Check the modifiers for the SARL capacities. * * @param capacity the capacity. */ @Check protected void checkModifiers(SarlCapacity capacity) { this.capacityModifierValidator.checkModifiers(capacity, MessageFormat.format(Messages.SARLValidator_9, capacity.getName())); }
/** Check if a capacity has a feature defined inside. * * @param capacity the capacity to test. */ @Check(CheckType.FAST) public void checkCapacityFeatures(SarlCapacity capacity) { if (capacity.getMembers().isEmpty()) { if (!isIgnored(DISCOURAGED_CAPACITY_DEFINITION)) { addIssue(Messages.SARLValidator_77, capacity, null, ValidationMessageAcceptor.INSIGNIFICANT_INDEX, DISCOURAGED_CAPACITY_DEFINITION, capacity.getName(), "aFunction"); //$NON-NLS-1$ } } }
/** Generate the given object. * * @param capacity the capacity. * @param context the context. */ protected void _generate(SarlCapacity capacity, IExtraLanguageGeneratorContext context) { final JvmDeclaredType jvmType = getJvmModelAssociations().getInferredType(capacity); final PyAppendable appendable = createAppendable(jvmType, context); final List<? extends JvmTypeReference> superTypes; if (!capacity.getExtends().isEmpty()) { superTypes = capacity.getExtends(); } else { superTypes = Collections.singletonList(getTypeReferences().getTypeForName(Capacity.class, capacity)); } if (generateTypeDeclaration( this.qualifiedNameProvider.getFullyQualifiedName(capacity).toString(), capacity.getName(), true, superTypes, getTypeBuilder().getDocumentation(capacity), true, capacity.getMembers(), appendable, context, null)) { final QualifiedName name = getQualifiedNameProvider().getFullyQualifiedName(capacity); writeFile(name, appendable, context); } }
error(MessageFormat.format( Messages.SARLValidator_71, capacity.getName(), type.getSimpleName()), expr, null,
if (Strings.isNullOrEmpty(source.getName())) { return;