|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.beanlib.provider.replicator.ReplicatorTemplate
public abstract class ReplicatorTemplate
A useful base class for the replicator implementations.
Field Summary | |
---|---|
private BeanTransformerSpi |
beanTransformer
|
protected org.apache.log4j.Logger |
log
|
Constructor Summary | |
---|---|
protected |
ReplicatorTemplate()
|
protected |
ReplicatorTemplate(BeanTransformerSpi beanTransformer)
|
Method Summary | ||
---|---|---|
protected
|
chooseClass(Class<?> fromClass,
Class<T> toClass)
Chooses a target class from the given "from" and "to" classes, giving priority to the one which is more specific whenever possible. |
|
protected boolean |
containsTargetCloned(Object from)
|
|
protected
|
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. |
|
protected
|
createToInstance(T from)
Creates a target instance using the class of the given object. |
|
private
|
createToInstanceWithComparator(Class<T> toClass,
Comparator<?> comparator)
|
|
protected
|
createToInstanceWithComparator(T from,
Comparator<?> comparator)
|
|
protected CustomBeanTransformerSpi |
getCustomerBeanTransformer()
|
|
protected Object |
getTargetCloned(Object from)
|
|
protected
|
newInstanceAsPrivileged(Class<T> c)
Creates a new instance of the given class via the no-arg constructor, invoking the constructor as a privileged action if it is protected or private. |
|
private
|
newInstanceWithComparatorAsPrivileged(Class<T> c,
Comparator<?> comparator)
|
|
protected void |
populateBean(Object fromMember,
Object toMember)
|
|
protected Object |
putTargetCloned(Object from,
Object to)
|
|
protected
|
replicate(Object from,
Class<T> toClass)
Replicate the given from object, recursively if necessary, to an instance of the toClass. |
|
protected
|
replicate(T from)
Replicate the given from object, recursively if necessary. |
|
protected
|
replicateByBeanReplicatable(Object from,
Class<T> toClass)
|
|
protected
|
transform(Object in,
Class<T> toClass,
PropertyInfo propertyInfo)
|
|
protected
|
unenhanceObject(T object)
Returns an equivalent object un-enhanced from the given object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final org.apache.log4j.Logger log
private final BeanTransformerSpi beanTransformer
Constructor Detail |
---|
protected ReplicatorTemplate(BeanTransformerSpi beanTransformer)
protected ReplicatorTemplate()
Method Detail |
---|
protected final CustomBeanTransformerSpi getCustomerBeanTransformer()
protected <T> T replicate(T from)
protected <T> T replicate(Object from, Class<T> toClass) throws SecurityException
SecurityException
protected <T> T replicateByBeanReplicatable(Object from, Class<T> toClass)
protected final <T> T createToInstance(T from) throws InstantiationException, IllegalAccessException, SecurityException, NoSuchMethodException
InstantiationException
IllegalAccessException
SecurityException
NoSuchMethodException
protected <T> T createToInstance(Object from, Class<T> toClass) throws InstantiationException, IllegalAccessException, SecurityException, NoSuchMethodException
InstantiationException
IllegalAccessException
SecurityException
NoSuchMethodException
protected final <T> Class<T> chooseClass(Class<?> fromClass, Class<T> toClass)
T
- target typefromClass
- from classtoClass
- target class
protected <T> T transform(Object in, Class<T> toClass, PropertyInfo propertyInfo)
protected void populateBean(Object fromMember, Object toMember)
protected <T> T createToInstanceWithComparator(T from, Comparator<?> comparator) throws SecurityException, NoSuchMethodException
SecurityException
NoSuchMethodException
private <T> T createToInstanceWithComparator(Class<T> toClass, Comparator<?> comparator) throws SecurityException, NoSuchMethodException
SecurityException
NoSuchMethodException
protected final <T> T newInstanceAsPrivileged(Class<T> c) throws SecurityException, NoSuchMethodException, InstantiationException, IllegalAccessException
c
- given class
SecurityException
NoSuchMethodException
InstantiationException
IllegalAccessException
private <T> T newInstanceWithComparatorAsPrivileged(Class<T> c, Comparator<?> comparator) throws SecurityException, NoSuchMethodException
SecurityException
NoSuchMethodException
protected final boolean containsTargetCloned(Object from)
protected final Object getTargetCloned(Object from)
protected final Object putTargetCloned(Object from, Object to)
protected <T> T unenhanceObject(T object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |