title: How can I map List<MyObject> to List<HashMap<String,Object>> with Dozer?
body: <p>Let's say I have an object Foo which holds a list of references to object Bar:</p>
  
  <pre><code>public class Foo{
      String fooStr;
      List&lt;Bar&gt; barList;
  
      //get/set barList/someStr go here
  }
  
  public class Bar {
      String barStr;
  }
  </code></pre>
  
  <p><strong>Using Dozer, assuming Bar to java.util.HashMap is a trivial mapping, how do I map instances of Foo to instances of java.util.HashMap such that the referenced instances of Bar are mapped to java.util.HashMap as well?</strong>  That is, I want the result of the mapping to be a HashMap with key "barList" which holds an instance of ArrayList>.  Each HashMap in this list should be a mapping of Bar to HashMap.</p>
  
  <p>For instance, if Foo held a single reference to Bar rather than a list, I'd do:</p>
  
  <pre><code>&lt;mapping&gt;
      &lt;class-a&gt;Foo&lt;/class-a&gt;
      &lt;class-b&gt;java.util.Map&lt;/class-b&gt;
  
      &lt;field&gt;
          &lt;a&gt;bar&lt;/a&gt;
          &lt;b key="bar"&gt;this&lt;/b&gt;
          &lt;a-hint&gt;Bar&lt;/a-hint&gt;
          &lt;b-hint&gt;java.util.Map&lt;/b-hint&gt;
      &lt;/field&gt;
  &lt;/mapping&gt;
  </code></pre>
  
  <p>And this would produce a hashmap that'd look like this (using JSON objects to represent HashMaps):</p>
  
  <pre><code>{
      "fooStr" : "value of fooStr",
      {
         "barStr" : "value of barStr"
      }
  }
  </code></pre>
  
  <p>But I want to know how I can express the conversion to HashMap with a list of references to Bar such that I get this:</p>
  
  <pre><code>{
      "fooStr" : "value of fooStr",
      "barList" : [{ "barStr" : "bar1" }, { "barStr" : "bar2" }, ...]
  }
  </code></pre>
  
  <p>Answers which do not use a custom mapper are preferred, but I understand if this is the only way of achieving this behavior.</p>