private static void write(final IonWriter writer, final WriteContext context, final GradleExtensions model) throws IOException {
    context.objectCollector.add(model, new ObjectCollector.Processor<IOException>() {
      @Override
      public void process(boolean isAdded, int objectId) throws IOException {
        writer.stepIn(IonType.STRUCT);
        writer.setFieldName(OBJECT_ID_FIELD);
        writer.writeInt(objectId);
        if (isAdded) {
          writeString(writer, "parentProjectPath", model.getParentProjectPath());
          writeConfigurations(writer, context, model.getConfigurations());
          writeConventions(writer, context, model.getConventions());
          writeExtensions(writer, context, model.getExtensions());
          writeGradleProperties(writer, context, model.getGradleProperties());
          // do not write tasks, as it will be added from ExternalProject model at BaseGradleProjectResolverExtension.populateModuleExtraModels
        }
        writer.stepOut();
      }
    });
  }
private static void write(final IonWriter writer, final WriteContext context, final GradleExtensions model)