|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.drools.camel.component.FastCloner
public class FastCloner
Cloner: deep clone objects. This class is thread safe. One instance can be used by multiple threads on the same time. 18 Sep 2008
Nested Class Summary | |
---|---|
static class |
FastCloner.FastClonerArrayList
|
static class |
FastCloner.FastClonerCalendar
|
static class |
FastCloner.FastClonerCustomCollection<T extends Collection>
|
static class |
FastCloner.FastClonerHashMap
|
static class |
FastCloner.FastClonerHashSet
|
static class |
FastCloner.FastClonerLinkedList
|
static class |
FastCloner.FastClonerTreeMap
|
static interface |
FastCloner.IFastCloner
|
Constructor Summary | |
---|---|
FastCloner()
|
Method Summary | ||
---|---|---|
protected
|
cloneInternal(T o,
Map<Object,Object> clones)
PLEASE DONT CALL THIS METHOD The only reason for been public is because IFastCloner must invoke it |
|
|
copyPropertiesOfInheritedClass(T src,
E dest)
copies all properties from src to dest. |
|
|
deepClone(T o)
deep clones "o". |
|
void |
dontClone(Class<?>... c)
instances of classes that shouldn't be cloned can be registered using this method. |
|
protected Object |
fastClone(Object o,
Map<Object,Object> clones)
|
|
|
fastCloneOrNewInstance(Class<T> c)
|
|
boolean |
isCloningEnabled()
|
|
boolean |
isDumpClonedClasses()
|
|
boolean |
isNullTransient()
|
|
void |
nullInsteadOfClone(Class<?>... c)
instead of cloning these classes will set the field to null |
|
void |
registerConstant(Class<?> c,
String privateFieldName)
|
|
void |
registerConstant(Object o)
|
|
void |
registerFastCloner(Class<?> c,
FastCloner.IFastCloner fastCloner)
|
|
protected void |
registerFastCloners()
registers a std set of fast cloners. |
|
void |
registerImmutable(Class<?>... c)
registers an immutable class. |
|
protected void |
registerKnownConstants()
|
|
protected void |
registerKnownJdkImmutableClasses()
registers some known JDK immutable classes. |
|
void |
registerStaticFields(Class<?>... classes)
registers all static fields of these classes. |
|
void |
setCloningEnabled(boolean cloningEnabled)
|
|
void |
setDumpClonedClasses(boolean dumpClonedClasses)
will println() all cloned classes. |
|
void |
setExtraImmutables(Set<Class<?>> set)
spring framework friendly version of registerImmutable |
|
void |
setExtraNullInsteadOfClone(Set<Class<?>> set)
spring framework friendly version of nullInsteadOfClone |
|
void |
setExtraStaticFields(Set<Class<?>> set)
spring framework friendly version of registerStaticFields |
|
void |
setNullTransient(boolean nullTransient)
this makes the cloner to set a transient field to null upon cloning. |
|
|
shallowClone(T o)
shallow clones "o". |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FastCloner()
Method Detail |
---|
public boolean isNullTransient()
public void setNullTransient(boolean nullTransient)
nullTransient
- true for transient fields to be nulledprotected void registerFastCloners()
protected Object fastClone(Object o, Map<Object,Object> clones) throws IllegalAccessException
IllegalAccessException
public void registerConstant(Object o)
public void registerConstant(Class<?> c, String privateFieldName)
protected void registerKnownJdkImmutableClasses()
protected void registerKnownConstants()
public void registerStaticFields(Class<?>... classes)
classes
- array of classespublic void setExtraStaticFields(Set<Class<?>> set)
set
- a set of classes which will be scanned for static fieldspublic void dontClone(Class<?>... c)
c
- The class that shouldn't be cloned. That is, whenever a deep clone for an object is created and c is encountered, the object
instance of c will be added to the clone.public void nullInsteadOfClone(Class<?>... c)
c
- the classes to nullify during cloningpublic void setExtraNullInsteadOfClone(Set<Class<?>> set)
public void registerImmutable(Class<?>... c)
c
- the immutable classpublic void setExtraImmutables(Set<Class<?>> set)
public void registerFastCloner(Class<?> c, FastCloner.IFastCloner fastCloner)
public <T> T fastCloneOrNewInstance(Class<T> c)
public <T> T deepClone(T o)
T
- the type of "o"o
- the object to be deep-cloned
public <T> T shallowClone(T o)
T
- the type of oo
- the object to be shallow-cloned
protected <T> T cloneInternal(T o, Map<Object,Object> clones) throws IllegalAccessException
IllegalAccessException
public <T,E extends T> void copyPropertiesOfInheritedClass(T src, E dest)
src
- the source objectdest
- the destination object which must contain as minimul all the fields of srcpublic boolean isDumpClonedClasses()
public void setDumpClonedClasses(boolean dumpClonedClasses)
dumpClonedClasses
- true to enable printing all cloned classespublic boolean isCloningEnabled()
public void setCloningEnabled(boolean cloningEnabled)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |