/** Append the SARL specification version as an annotation to the given container. * * <p>The added annotation may be used by any underground platform for determining what is * the version of the SARL specification that was used for generating the container. * * @param context the current generation context. * @param source the source object. * @param target the inferred JVM object. */ protected void appendSARLSpecificationVersion(GenerationContext context, XtendTypeDeclaration source, JvmDeclaredType target) { addAnnotationSafe(target, SarlSpecification.class, SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING); }
/** Append the SARL element type as an annotation to the given container. * * <p>The added annotation may be used by any underground platform for determining what is * the type of the SARL element without invoking the costly "instanceof" operations. * * @param source the source object. * @param target the inferred JVM object. */ protected void appendSARLElementType(XtendTypeDeclaration source, JvmDeclaredType target) { addAnnotationSafe(target, SarlElementType.class, source.eClass().getClassifierID()); }
/** Add the @Generated annotation to the given target. * * @param target the target of the annotation. * @param context the generation context. * @param sarlCode the code that is the cause of the generation. */ protected void appendGeneratedAnnotation(JvmAnnotationTarget target, GenerationContext context, String sarlCode) { final GeneratorConfig config = context.getGeneratorConfig(); if (config.isGenerateGeneratedAnnotation()) { addAnnotationSafe(target, Generated.class, getClass().getName()); } if (target instanceof JvmFeature) { addAnnotationSafe(target, SyntheticMember.class); } if (!Strings.isNullOrEmpty(sarlCode)) { addAnnotationSafe(target, SarlSourceCode.class, sarlCode); } }
/** Append the @FunctionalInterface to the given type if it is a functional interface according * to the Java 8 specification definition. * * @param type the type to update. */ protected void appendFunctionalInterfaceAnnotation(JvmGenericType type) { if (type != null && Utils.isFunctionalInterface(type, this.sarlSignatureProvider) && this.annotationFinder.findAnnotation(type, FunctionalInterface.class) == null) { addAnnotationSafe(type, FunctionalInterface.class); } }
this.readAndWriteTracking.markInitialized(field, null); addAnnotationSafe(lastParam, DefaultValue.class, namePostPart); addAnnotationSafe(owner, DefaultValueSource.class);
return null; addAnnotationSafe(result, Override.class); if (generatePureAnnotation) { addAnnotationSafe(result, Pure.class);
appendGeneratedAnnotation(op, context); if (context.getGeneratorConfig2().isGeneratePureAnnotation()) { addAnnotationSafe(op, Pure.class);
addAnnotationSafe(op, DefaultValueUse.class, originalSignature); appendGeneratedAnnotation(op, context);
target.getMembers().add(operation); operation.setVisibility(JvmVisibility.PUBLIC); addAnnotationSafe(operation, Override.class); if (context.getGeneratorConfig2().isGeneratePureAnnotation()) { addAnnotationSafe(operation, Pure.class);
&& this.annotationFinder.findAnnotation(operation, Override.class) == null && this.typeReferences.findDeclaredType(Override.class, source) != null) { addAnnotationSafe(operation, Override.class); isEarlyExit = this.earlyExitComputer.isEarlyExitOperation(action); if (isEarlyExit) { addAnnotationSafe(operation, EarlyExit.class); if (this.annotationFinder.findAnnotation(implementedOperation, DefaultValueSource.class) != null && this.annotationFinder.findAnnotation(operation, DefaultValueSource.class) == null) { addAnnotationSafe(operation, DefaultValueSource.class); if (ovalue != null && this.annotationFinder.findAnnotation(cp, DefaultValue.class) == null) { addAnnotationSafe(cp, DefaultValue.class, this.sarlSignatureProvider.qualifyDefaultValueID( && SARLJvmModelInferrer.this.typeReferences.findDeclaredType( Override.class, source) != null) { addAnnotationSafe( operation, Override.class); addAnnotationSafe( operation2, DefaultValueUse.class, actionSignatures.getFormalParameterTypes().toString()); addAnnotationSafe( operation2, EarlyExit.class);
constructor2, container, isVarArgs, otherSignature); addAnnotationSafe( constructor2, DefaultValueUse.class, constructorSignatures.getFormalParameterTypes().toString());
addAnnotationSafe(field, Extension.class); field.getAnnotations().add(annotationClassRef(ImportedCapacityFeature.class, Collections.singletonList(capacityType))); addAnnotationSafe(operation, Pure.class);
addAnnotationSafe(operation, PerceptGuardEvaluator.class);
if (context.getGeneratorConfig2().isGeneratePureAnnotation() && !this.services.getExpressionHelper().hasSideEffects(source.getExpression())) { addAnnotationSafe(bodyOperation, Pure.class); addAnnotationSafe(guardOperation, Pure.class);
return null; addAnnotationSafe(result, Override.class); if (generatePureAnnotation) { addAnnotationSafe(result, Pure.class);