Closed GoogleCodeExporter closed 9 years ago
added IInstantiationStrategy that allows construction of new instances. Also
added a cloner constructor that allows providing of an IInstantiationStrategy.
Original comment by kostas.k...@googlemail.com
on 17 Jul 2012 at 7:36
It turns out that there are two different strategies that you need to implement
based on the android OS version. The ObjectInputStream method will only work
on older android OS versions. Did you test on newer versions? They require a
similar method based on ObjectStreamClass
Original comment by cherry...@gmail.com
on 17 Jul 2012 at 9:28
Hi Cherrydev, I didn't create any strategy for Android OS, I don't have a way
to test it anyway.
The IInstantiationStrategy is impl in 1.8.2 and when this is deployed you could
use it to implement any strategy you require for your android app. In fact, if
it works well for you, you might want to share it and become part of cloner
library ;)
Original comment by kostas.k...@googlemail.com
on 17 Jul 2012 at 9:30
1.8.2 is out (but not sure if sync'd with maven central yet)
Original comment by kostas.k...@googlemail.com
on 25 Jul 2012 at 9:23
So... Does that mean that cloner is now only optionally dependant on Objenesis?
The approach I had taken previously is to implement my own Objenesis and pass
that to the Cloner.
Original comment by cherry...@gmail.com
on 25 Jul 2012 at 11:26
not sure what will happen if your remove objenesis from classpath. It might not
work because still some dependent classes import objenesis.
But now you can implement your own instantiation strategy and pass it to
Cloner's constructor:
public Cloner(IInstantiationStrategy instantiationStrategy)
The instantiation strategy has one method only:
public interface IInstantiationStrategy
{
<T> T newInstance(final Class<T> c);
}
Original comment by kostas.k...@googlemail.com
on 29 Jul 2012 at 5:35
Hello !
I need Cloning to run on Gingerbread / Android API 10 and upwards. Could you
please share the strategies to make Cloning work ? with or without Objenesis ?
Best Regards
H.D. Le
Original comment by lhdang...@gmail.com
on 21 Apr 2013 at 11:15
Original issue reported on code.google.com by
cherry...@gmail.com
on 4 Jul 2012 at 7:53