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)
           
<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.
protected
<T> T
unenhanceObject(T from)
          Returns an equivalent object un-enhanced from the given object.
 
Methods inherited from class net.sf.beanlib.provider.replicator.BeanReplicator
populate, replicateBean, replicateBean
 
Methods inherited from class net.sf.beanlib.provider.replicator.ReplicatorTemplate
chooseClass, containsTargetCloned, createToInstance, createToInstanceWithComparator, getCustomerBeanTransformer, 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 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 - the original bean to be replicated
toClass - target class to be instantiated

unenhanceObject

protected final <T> T unenhanceObject(T from)
Description copied from class: ReplicatorTemplate
Returns an equivalent object un-enhanced from the given object. By default, the input object is returned. Subclass must override this method to perform any such un-enhancement, if necessary.

Overrides:
unenhanceObject in class ReplicatorTemplate