Package org.powermock.classloading
Class DeepCloner
java.lang.Object
org.powermock.classloading.DeepCloner
- All Implemented Interfaces:
DeepClonerSPI
The purpose of the deep cloner is to create a deep clone of an object. An object can also be cloned to a different class-loader.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionClone using the current ContextClassLoader.DeepCloner
(ClassLoader classLoader) Clone using the supplied ClassLoader. -
Method Summary
-
Field Details
-
xStream
private final com.thoughtworks.xstream.XStream xStream
-
-
Constructor Details
-
DeepCloner
Clone using the supplied ClassLoader.- Parameters:
classLoader
- - the classloader to loaded cloned classes.
-
DeepCloner
public DeepCloner()Clone using the current ContextClassLoader.
-
-
Method Details
-
disableSecurity
private void disableSecurity() -
clone
public <T> T clone(T objectToClone) Clones an object.- Specified by:
clone
in interfaceDeepClonerSPI
- Parameters:
objectToClone
- the object to clone.- Returns:
- A deep clone of the object to clone.
-