title: How to deserialize Kotlin delegates in GSON
body: <p>I have this class: </p>
  
  <pre><code>class Project {
      val nameProperty = SimpleStringProperty("foobar")
      val name by nameProperty
  }
  </code></pre>
  
  <p>I use <a href="https://github.com/joffrey-bion/fx-gson" rel="nofollow noreferrer">Fx-GSON</a> library to serialize JavaFx Properties.</p>
  
  <p>When I serialize it to JSON I get this:</p>
  
  <pre><code>{
      "nameProperty": "foobar",
      "name$delegate": "foobar"
  }
  </code></pre>
  
  <p>But when I deserialize it back to the object of type <code>Project</code> the <code>name</code> and <code>nameProperty</code> are <strong>2 different objects</strong>.</p>
  
  <p>How to make <code>name</code> property delegate to the new <code>nameProperty</code>?</p>