title: How can I manually create my own object during deserialization?
body: <p>The default behavior of Serializable creates the object in a special way independent of constructors. Serializable will by default use reflection to read and write all non-transient non-static fields.</p>
  
  <p>Externalizable on the other hand doesn't use reflection and is therefore faster but requires you to do things yourself: this is what I want.</p>
  
  <blockquote>
    <p>During deserialization Class.newInstance() will be used. This means that the Externalizable class must have a public no-arg constructor.</p>
  </blockquote>
  
  <p>A public no-arg constructor is unacceptable and sometimes even impossible in the case of a non-static final field.</p>
  
  <p>With a bit of digging I found android.os.Parcelable which allows me to create the object myself. There's also com.hazelcast.nio.serialization.IdentifiedDataSerializable but I'd have to create a factory class and register it and it just looks like a lot of unnecessary work compared to Parcelable.</p>
  
  <p>My code is not android and currently uses no libraries. So I have 2 questions:</p>
  
  <ol>
  <li>Is it possible to use Parcelable in non-android Java code?</li>
  <li>What's the easiest way/lowest impact library that will allow me to create and return my own objects during deserialization? Also the library can't cost money.</li>
  </ol>
  
  <p>And yes I am aware of serialization proxies but that isn't the point of the question.</p>