net.sf.beanlib.hibernate3
Class Hibernate3CollectionReplicator

java.lang.Object
  extended by net.sf.beanlib.provider.replicator.ReplicatorTemplate
      extended by net.sf.beanlib.provider.replicator.CollectionReplicator
          extended by net.sf.beanlib.hibernate3.Hibernate3CollectionReplicator
All Implemented Interfaces:
CollectionReplicatorSpi

public class Hibernate3CollectionReplicator
extends CollectionReplicator

Hibernate 3 specific Collection Replicator.

Author:
Joe D. Velopar

Nested Class Summary
static class Hibernate3CollectionReplicator.Factory
          Factory for Hibernate3CollectionReplicator
 
Field Summary
private static Hibernate3CollectionReplicator.Factory factory
           
 
Fields inherited from class net.sf.beanlib.provider.replicator.ReplicatorTemplate
log
 
Constructor Summary
protected Hibernate3CollectionReplicator(BeanTransformerSpi beanTransformer)
           
 
Method Summary
protected  Collection<Object> createToCollection(Collection<?> from)
           
protected
<T> T
createToInstance(Object from, Class<T> toClass)
           
static Hibernate3CollectionReplicator.Factory getFactory()
           
private  boolean isHibernatePackage(Class c)
          Returns true if the given class has a package name that starts with "org.hibernate."; false otherwise.
static Hibernate3CollectionReplicator newCollectionReplicatable(BeanTransformerSpi beanTransformer)
           
<V,T> T
replicateCollection(Collection<V> from, Class<T> toClass)
          Returns a replicated collection.
 
Methods inherited from class net.sf.beanlib.provider.replicator.CollectionReplicator
createToComparator, createToInstanceAsCollection, createToSortedSetWithComparator
 
Methods inherited from class net.sf.beanlib.provider.replicator.ReplicatorTemplate
chooseClass, 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
 

Field Detail

factory

private static final Hibernate3CollectionReplicator.Factory factory
Constructor Detail

Hibernate3CollectionReplicator

protected Hibernate3CollectionReplicator(BeanTransformerSpi beanTransformer)
Method Detail

getFactory

public static final Hibernate3CollectionReplicator.Factory getFactory()

newCollectionReplicatable

public static Hibernate3CollectionReplicator 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
Overrides:
replicateCollection in class CollectionReplicator
Type Parameters:
V - component type of the from collection
T - target class type
Parameters:
from - from collection
toClass - target class

createToCollection

protected Collection<Object> createToCollection(Collection<?> from)
                                         throws InstantiationException,
                                                IllegalAccessException,
                                                SecurityException,
                                                NoSuchMethodException,
                                                InvocationTargetException
Overrides:
createToCollection in class CollectionReplicator
Throws:
InstantiationException
IllegalAccessException
SecurityException
NoSuchMethodException
InvocationTargetException

isHibernatePackage

private boolean isHibernatePackage(Class c)
Returns true if the given class has a package name that starts with "org.hibernate."; false otherwise.


createToInstance

protected <T> T createToInstance(Object from,
                                 Class<T> toClass)
                      throws InstantiationException,
                             IllegalAccessException,
                             SecurityException,
                             NoSuchMethodException
Overrides:
createToInstance in class ReplicatorTemplate
Throws:
InstantiationException
IllegalAccessException
SecurityException
NoSuchMethodException