Why will it involve sorting ? If I understand this correctly, In a
custom transformer, you can create a LinkedHashMap as the target
instance, and then put the cloned elements in the same order as you
retrieve them which are already sorted.
Another alternative would be to plug in your own implementation of
MapReplicatorSpi (and the associated factory), via
BeanTransformer#initMapReplicatableFactory, to always create a
LinkedHashMap instead of HashMap as the default.
See MapReplicator.java for a reference implementation.
Hope this helps.
Hanson