@Override
  public void serialize(@NotNull Object bean, @NotNull Element parent, @Nullable SerializationFilter filter) {
    Object value = accessor.read(bean);
    if (value == null) {
      return;
    }

    if (isFlat) {
      if (beanStyle == Property.Style.ATTRIBUTE && value instanceof Rectangle) {
        Rectangle bounds = (Rectangle)value;
        assert parent != null;
        parent.setAttribute("x", Integer.toString(bounds.x));
        parent.setAttribute("y", Integer.toString(bounds.y));
        parent.setAttribute("width", Integer.toString(bounds.width));
        parent.setAttribute("height", Integer.toString(bounds.height));
      }
      else {
        ((BeanBinding)binding).serializeProperties(value, parent, filter);
      }
    }
    else {
      binding.serialize(value, parent, filter);
    }
  }
@Override
  public void serialize(@NotNull Object bean, @NotNull Element parent, @Nullable SerializationFilter filter)