net.sf.beanlib.provider.replicator
Class MapReplicator
java.lang.Object
net.sf.beanlib.provider.replicator.ReplicatorTemplate
net.sf.beanlib.provider.replicator.MapReplicator
- All Implemented Interfaces:
- MapReplicatorSpi
- Direct Known Subclasses:
- Hibernate3MapReplicator
public class MapReplicator
- extends ReplicatorTemplate
- implements MapReplicatorSpi
Default implementation of MapReplicatorSpi
.
- Author:
- Joe D. Velopar
Methods inherited from class net.sf.beanlib.provider.replicator.ReplicatorTemplate |
chooseClass, containsTargetCloned, createToInstance, createToInstance, createToInstanceWithComparator, getCustomerBeanTransformer, getTargetCloned, newInstanceAsPrivileged, populateBean, putTargetCloned, replicate, replicate, replicateByBeanReplicatable, transform, unenhanceObject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
factory
private static final MapReplicator.Factory factory
MapReplicator
protected MapReplicator(BeanTransformerSpi beanTransformer)
newMapReplicatable
public static MapReplicator newMapReplicatable(BeanTransformerSpi beanTransformer)
replicateMap
public <K,V,T> T replicateMap(Map<K,V> from,
Class<T> toClass)
- Description copied from interface:
MapReplicatorSpi
- Returns a replicated map.
- Specified by:
replicateMap
in interface MapReplicatorSpi
- Type Parameters:
K
- key type of the from mapV
- value type of the from mapT
- target class type- Parameters:
from
- from maptoClass
- target class
createToMap
private <K,V> Map<K,V> createToMap(Map<K,V> from)
throws InstantiationException,
IllegalAccessException,
SecurityException,
NoSuchMethodException
- Throws:
InstantiationException
IllegalAccessException
SecurityException
NoSuchMethodException
createToInstanceAsMap
private <K,V> Map<K,V> createToInstanceAsMap(Map<K,V> from)
throws InstantiationException,
IllegalAccessException,
NoSuchMethodException
- Throws:
InstantiationException
IllegalAccessException
NoSuchMethodException
createToComparator
private <K,V> Comparator<K> createToComparator(SortedMap<K,V> fromSortedMap)
- Returns a replicated comparator of the given sorted map, or null if there is no comparator.
createToSortedMapWithComparator
private <K,V> SortedMap<K,V> createToSortedMapWithComparator(SortedMap<K,V> from,
Comparator<? super K> comparator)
throws NoSuchMethodException,
SecurityException
- Throws:
NoSuchMethodException
SecurityException