title: Elegant mapping from POJOs to vertx.io's JsonObject?
body: <p>I am currently working on a <a href="http://vertx.io">vertx.io</a> application and wanted to use the provide mongo api for data storage.  I currently have a rather clunky abstraction on top of the stock JsonObject classes where all <code>get</code> and <code>set</code> methods are  replaced with things like:</p>
  
  <pre><code>this.backingObject.get(KEY_FOR_THIS_PROPERTY);
  </code></pre>
  
  <p>This is all well and good for now, but it won't scale particularly well.  it also seems dirty, specifically when using nested arrays or objects.  For example, if I want to be able to fill fields only when actual data is known, I have to check if the array exists, and if it doesn't create it and store it in the object.  Then I can add an element to the list.  For example:</p>
  
  <pre><code>if (this.backingObject.getJsonArray(KEY_LIST) == null) {
      this.backingObject.put(KEY_LIST, new JsonArray());
  }
  this.backingObject.getJsonArray(KEY_LIST).add(p.getBackingObject());
  </code></pre>
  
  <p>I have thought about potential solutions but don't particularly like any of them.  Namely, I <em>could</em> use Gson or some similar library with annotation support to handle loading the object for the purposes of manipulating the data in my code, and then using the serialize and unserialize function of both Gson and Vertx to convert between the formats <code>(vertx to load data -&gt; json string -&gt; gson to parse json into pojos -&gt; make changes -&gt; serialize to json string -&gt; parse with vertx and save)</code> but that's a really gross and inefficient workflow.  I could also probably come up with some sort of abstract wrapper that extends/implements the vertx json library but passes all the functionality through to gson, but that also seems like a lot of work.</p>
  
  <p>Is there any good way to achieve more friendly and maintainable serialization using vertx?</p>