title: spring data mongodb: access default POJO converter from within custom converter
body: <p>I have spring data mongo custom converters setup via xml as follows</p>
  
  <pre><code>&lt;mongo:mapping-converter id="mongoConverter" db-factory-ref="mongoDbFactory"&gt;
      &lt;mongo:custom-converters&gt;
          &lt;mongo:converter ref="customWriteConverter" /&gt;
          &lt;mongo:converter ref="customReadConverter" /&gt;
      &lt;/mongo:custom-converters&gt;
  &lt;/mongo:mapping-converter&gt;
  
  &lt;bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate"&gt;
      &lt;constructor-arg ref="mongoDbFactory"/&gt;
      &lt;constructor-arg ref="mongoConverter"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="customWriteConverter" class="package.WriteConverter" /&gt;
  &lt;bean id="customReadConverter" class="package.ReadConverter" /&gt;
  </code></pre>
  
  <p>In the custom read/write converter, I would like to re-use spring-data-mongo's default pojo converter to save certain properties as subdocuments.</p>
  
  <p>consider a simplified example -</p>
  
  <pre><code>class A {
      B b;
      String var1;
      int var2;
  }
  
  class B {
      String var3;
      String var4;
  }
  </code></pre>
  
  <p>I want to handle conversion of class A using <code>customWriteConverter</code> and <code>customReadConverter</code>, but in my custom converters I also want to delegate conversion of class B back to spring-data-mongo's default POJO converter.</p>
  
  <p>How can I do this? I have not been able to successfully autowire a MongoConverter or MongoTemplate into the custom converter since the MongoConverter/MongoTemplate bean creation is in progress when it tries to create the custom converter. Is it possible to get access to the default converter and use that from within the custom converter?</p>