/** Transform the field. * * @param source the feature to transform. * @param container the target container of the transformation result. */ @Override protected void transform(XtendField source, JvmGenericType container) { super.transform(source, container); // Override the visibility final JvmField field = (JvmField) this.sarlAssociations.getPrimaryJvmElement(source); setVisibility(field, source); final GenerationContext context = getContext(container); if (context != null) { final String name = source.getName(); if (!Strings.isNullOrEmpty(name)) { context.incrementSerial(name.hashCode()); } final JvmTypeReference type = source.getType(); if (type != null) { context.incrementSerial(type.getIdentifier().hashCode()); } } }
/** Generate the implemented types for the given SARL statement. * * @param context the context of the generation. * @param owner the JVM element to change. * @param defaultJvmType the default JVM type. * @param defaultSarlType the default SARL type. * @param implementedtypes the implemented types. */ protected void appendConstrainedImplements( GenerationContext context, JvmGenericType owner, Class<?> defaultJvmType, Class<? extends XtendTypeDeclaration> defaultSarlType, List<? extends JvmParameterizedTypeReference> implementedtypes) { boolean explicitType = false; for (final JvmParameterizedTypeReference superType : implementedtypes) { if (!Objects.equal(owner.getIdentifier(), superType.getIdentifier()) && superType.getType() instanceof JvmGenericType /*&& this.inheritanceHelper.isProxyOrSubTypeOf(superType, defaultJvmType, defaultSarlType, true)*/) { owner.getSuperTypes().add(this.typeBuilder.cloneWithProxies(superType)); context.incrementSerial(superType.getIdentifier().hashCode()); explicitType = true; } } if (!explicitType) { final JvmTypeReference type = this._typeReferenceBuilder.typeRef(defaultJvmType); owner.getSuperTypes().add(type); context.incrementSerial(type.getIdentifier().hashCode()); } }
context.incrementSerial(superType.getIdentifier().hashCode()); explicitType = true; final JvmTypeReference type = this._typeReferenceBuilder.typeRef(defaultJvmType); owner.getSuperTypes().add(type); context.incrementSerial(type.getIdentifier().hashCode());
context.getPreFinalizationElements().add(differedGeneration); context.setActionIndex(context.getActionIndex() + 1); context.incrementSerial(sigKey.hashCode()); } else { differedGeneration.run();
context.getPreFinalizationElements().add(differedGeneration); context.setActionIndex(context.getActionIndex() + 1); context.incrementSerial(actSigKey.hashCode()); } else { differedGeneration.run();
context.incrementSerial(capacityType.getIdentifier().hashCode());
context.incrementSerial(bodyMethodName.hashCode()); } else { logInternalError(Messages.SARLJvmModelInferrer_10);