net.sf.beanlib.provider.replicator
Class CollectionReplicator
java.lang.Object
net.sf.beanlib.provider.replicator.ReplicatorTemplate
net.sf.beanlib.provider.replicator.CollectionReplicator
- All Implemented Interfaces:
- CollectionReplicatorSpi
- Direct Known Subclasses:
- Hibernate3CollectionReplicator
public class CollectionReplicator
- extends ReplicatorTemplate
- implements CollectionReplicatorSpi
Default implementation of CollectionReplicatorSpi
.
- 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 CollectionReplicator.Factory factory
CollectionReplicator
protected CollectionReplicator(BeanTransformerSpi beanTransformer)
newCollectionReplicatable
public static CollectionReplicator newCollectionReplicatable(BeanTransformerSpi beanTransformer)
replicateCollection
public <V,T> T replicateCollection(Collection<V> from,
Class<T> toClass)
- Description copied from interface:
CollectionReplicatorSpi
- Returns a replicated collection.
- Specified by:
replicateCollection
in interface CollectionReplicatorSpi
- Type Parameters:
V
- component type of the from collectionT
- target class type- Parameters:
from
- from collectiontoClass
- target class
createToCollection
protected Collection<Object> createToCollection(Collection<?> from)
throws InstantiationException,
IllegalAccessException,
SecurityException,
NoSuchMethodException,
InvocationTargetException
- Throws:
InstantiationException
IllegalAccessException
SecurityException
NoSuchMethodException
InvocationTargetException
createToInstanceAsCollection
protected final Collection<Object> createToInstanceAsCollection(Collection<?> from)
throws InstantiationException,
IllegalAccessException,
NoSuchMethodException
- Throws:
InstantiationException
IllegalAccessException
NoSuchMethodException
createToSortedSetWithComparator
protected final SortedSet<Object> createToSortedSetWithComparator(SortedSet from,
Comparator comparator)
throws NoSuchMethodException,
SecurityException
- Throws:
NoSuchMethodException
SecurityException
createToComparator
protected Comparator createToComparator(SortedSet fromSortedSet)
- Returns a replicated comparator of the given sorted set, or null if there is no comparator.