Package org.powermock.classloading
Class DeepCloner
- java.lang.Object
-
- org.powermock.classloading.DeepCloner
-
- All Implemented Interfaces:
DeepClonerSPI
public class DeepCloner extends java.lang.Object implements 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 Modifier and Type Field Description private com.thoughtworks.xstream.XStreamxStream
-
Constructor Summary
Constructors Constructor Description DeepCloner()Clone using the current ContextClassLoader.DeepCloner(java.lang.ClassLoader classLoader)Clone using the supplied ClassLoader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Tclone(T objectToClone)Clones an object.private voiddisableSecurity()
-
-
-
Method Detail
-
disableSecurity
private void disableSecurity()
-
clone
public <T> T clone(T objectToClone)
Clones an object.- Specified by:
clonein interfaceDeepClonerSPI- Parameters:
objectToClone- the object to clone.- Returns:
- A deep clone of the object to clone.
-
-