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, createToInstance, createToInstance, createToInstanceWithComparator, getTargetCloned, newInstanceAsPrivileged, populateBean, putTargetCloned, replicate, replicate, replicateByBeanReplicatable, transform |
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 Map<Object,Object> createToMap(Map<?,?> from)
throws InstantiationException,
IllegalAccessException,
SecurityException,
NoSuchMethodException
- Throws:
InstantiationException
IllegalAccessException
SecurityException
NoSuchMethodException
createToInstanceAsMap
private Map<Object,Object> createToInstanceAsMap(Map<?,?> from)
throws InstantiationException,
IllegalAccessException,
NoSuchMethodException
- Throws:
InstantiationException
IllegalAccessException
NoSuchMethodException
createToComparator
private Comparator<Object> createToComparator(SortedMap fromSortedMap)
- Returns a replicated comparator of the given sorted map, or null if there is no comparator.
createToSortedMapWithComparator
private SortedMap<Object,Object> createToSortedMapWithComparator(SortedMap from,
Comparator comparator)
throws NoSuchMethodException,
SecurityException
- Throws:
NoSuchMethodException
SecurityException