net.sf.beanlib.hibernate3
Class Hibernate3JavaBeanReplicator

java.lang.Object
  extended by net.sf.beanlib.provider.replicator.ReplicatorTemplate
      extended by net.sf.beanlib.provider.replicator.BeanReplicator
          extended by net.sf.beanlib.hibernate3.Hibernate3JavaBeanReplicator
All Implemented Interfaces:
BeanReplicatorSpi

public class Hibernate3JavaBeanReplicator
extends BeanReplicator

Hibernate 3 specific JavaBean Replicator.

Author:
Joe D. Velopar

Nested Class Summary
static class Hibernate3JavaBeanReplicator.Factory
          Factory for Hibernate3JavaBeanReplicator
 
Field Summary
private static Hibernate3JavaBeanReplicator.Factory factory
           
 
Fields inherited from class net.sf.beanlib.provider.replicator.ReplicatorTemplate
log
 
Constructor Summary
protected Hibernate3JavaBeanReplicator(BeanTransformerSpi beanTransformer)
           
 
Method Summary
protected
<T> T
createToInstance(Object from, Class<T> toClass)
          Creates a target instance from either the class of the given "from" object or the given toClass, giving priority to the one which is more specific whenever possible.
static Hibernate3JavaBeanReplicator.Factory getFactory()
           
static Hibernate3JavaBeanReplicator newBeanReplicatable(BeanTransformerSpi beanTransformer)
           
protected
<T> T
replicate(T from)
          Replicate the given from object, recursively if necessary.
<V,T> T
replicateBean(V from, Class<T> toClass)
          Replicates the properties of a JavaBean object to an instance of a target class, which is selected from the given "from" and "to" classes, giving priority to the one which is more specific whenever possible.
 
Methods inherited from class net.sf.beanlib.provider.replicator.BeanReplicator
replicateBean, replicateBean
 
Methods inherited from class net.sf.beanlib.provider.replicator.ReplicatorTemplate
chooseClass, containsTargetCloned, createToInstance, createToInstanceWithComparator, getCustomerBeanTransformer, getTargetCloned, newInstanceAsPrivileged, populateBean, putTargetCloned, 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 Hibernate3JavaBeanReplicator.Factory factory
Constructor Detail

Hibernate3JavaBeanReplicator

protected Hibernate3JavaBeanReplicator(BeanTransformerSpi beanTransformer)
Method Detail

getFactory

public static Hibernate3JavaBeanReplicator.Factory getFactory()

newBeanReplicatable

public static Hibernate3JavaBeanReplicator newBeanReplicatable(BeanTransformerSpi beanTransformer)

createToInstance

protected <T> T createToInstance(Object from,
                                 Class<T> toClass)
                      throws InstantiationException,
                             IllegalAccessException,
                             SecurityException,
                             NoSuchMethodException
Description copied from class: ReplicatorTemplate
Creates a target instance from either the class of the given "from" object or the given toClass, giving priority to the one which is more specific whenever possible.

Overrides:
createToInstance in class ReplicatorTemplate
Throws:
InstantiationException
IllegalAccessException
SecurityException
NoSuchMethodException

replicateBean

public <V,T> T replicateBean(V from,
                             Class<T> toClass)
Description copied from class: BeanReplicator
Replicates the properties of a JavaBean object to an instance of a target class, which is selected from the given "from" and "to" classes, giving priority to the one which is more specific whenever possible.

Specified by:
replicateBean in interface BeanReplicatorSpi
Overrides:
replicateBean in class BeanReplicator
Type Parameters:
V - from type
T - target type
Parameters:
from - from bean (after unenhancement) to be replicated
toClass - target class to be instantiated

replicate

protected <T> T replicate(T from)
Description copied from class: ReplicatorTemplate
Replicate the given from object, recursively if necessary. Currently a property is replicated if it is an instance of Collection, Map, Timestamp, Date, Blob, Hibernate entity, JavaBean, or an array.

Overrides:
replicate in class ReplicatorTemplate