title: Flex JSON unable to properly serialize/deserialize LinkedHashMap
body: <p>I tried to serialize and deseriliaze LinkedHashMap data as follow:</p>
  
  <pre><code>LinkedHashMap&lt;String, Object&gt; o = new LinkedHashMap&lt;String, Object&gt;();
  o.put("1", "a");
  o.put("2", "b");
  o.put("3", "c");
  o.put("4", new BigDecimal("9999999999999999999999.00999999999999999999999"));
  
  String serialize = new JSONSerializer().deepSerialize(o);
  System.out.println("serialize" + serialize);
  
  LinkedHashMap deserialize = new JSONDeserializer&lt;LinkedHashMap&gt;().deserialize(serialize, LinkedHashMap.class);
  System.out.println("deserialize:" + deserialize);
  </code></pre>
  
  <p>and I get ClassCastException:</p>
  
  <pre><code>serialize{"1":"a","2":"b","3":"c","4":9999999999999999999999.00999999999999999999999}
  Exception in thread "main" java.lang.ClassCastException: java.util.HashMap cannot be cast to java.util.LinkedHashMap
      at com.JSONUtil.main(JSONUtil.java:161)
  </code></pre>
  
  <p>So I tried slightly different approach when deserializing as follow:</p>
  
  <pre><code>HashMap deserialize = new JSONDeserializer&lt;HashMap&gt;().deserialize(serialize, HashMap.class);
  System.out.println("deserialize:" + deserialize);
  </code></pre>
  
  <p>This time I get result but the Map is unordered (I think because it is now using HashMap). In addition, the BigDecimal value is not displayed like the original format.</p>
  
  <pre><code>deserialize:{3=c, 2=b, 1=a, 4=1.0E22}
  </code></pre>
  
  <p>It appears that FlexJSON has issue with sorted Map. I guess this is because it has no way to put 'class' entry like the example below, eg.</p>
  
  <pre><code>"class":"ch.qos.logback.classic.Logger","debugEnabled":true,"errorEnabled":true,"infoEnabled":true}
  </code></pre>
  
  <p>or perhaps there is another way to do this. Can anyone please help?
  Thank you</p>
  
  <hr>
  
  <p>After introducing ObjectFactory as suggested by chubbsondubs:</p>
  
  <pre><code>LinkedHashMap deserialize = new JSONDeserializer&lt;LinkedHashMap&gt;()
  .use(LinkedHashMap.class, new ObjectFactory() {
  public Object instantiate(ObjectBinder context, Object value, Type targetType, Class targetClass) {
      System.out.println("mymap:"value);
  }
  }).deserialize(serialize, LinkedHashMap.class);
  </code></pre>
  
  <p>The value object has HashMap type and it prints: </p>
  
  <pre><code>mymap:{3=c, 2=b, 1=a, 4=flexjson.JsonNumber@104fc23}
  </code></pre>