net.sf.beanlib.hibernate3
Class Hibernate3MapReplicator

java.lang.Object
  extended by net.sf.beanlib.provider.replicator.ReplicatorTemplate
      extended by net.sf.beanlib.provider.replicator.MapReplicator
          extended by net.sf.beanlib.hibernate3.Hibernate3MapReplicator
All Implemented Interfaces:
MapReplicatorSpi

public class Hibernate3MapReplicator
extends MapReplicator

Hibernate 3 specific Map Replicator.

Author:
Joe D. Velopar

Nested Class Summary
static class Hibernate3MapReplicator.Factory
          Factory for MapReplicator
 
Field Summary
private static Hibernate3MapReplicator.Factory factory
           
 
Fields inherited from class net.sf.beanlib.provider.replicator.ReplicatorTemplate
log
 
Constructor Summary
protected Hibernate3MapReplicator(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 Hibernate3MapReplicator.Factory getFactory()
           
static Hibernate3MapReplicator newMapReplicatable(BeanTransformerSpi beanTransformer)
           
<K,V,T> T
replicateMap(Map<K,V> from, Class<T> toClass)
          Returns a replicated map.
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.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 Hibernate3MapReplicator.Factory factory
Constructor Detail

Hibernate3MapReplicator

protected Hibernate3MapReplicator(BeanTransformerSpi beanTransformer)
Method Detail

getFactory

public static Hibernate3MapReplicator.Factory getFactory()

newMapReplicatable

public static Hibernate3MapReplicator 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
Overrides:
replicateMap in class MapReplicator
Type Parameters:
K - key type of the from map
V - value type of the from map
T - target class type
Parameters:
from - from map
toClass - target class

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

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