Package org.jboss.marshalling.cloner
Class CloneableCloner
- java.lang.Object
-
- org.jboss.marshalling.cloner.CloneableCloner
-
- All Implemented Interfaces:
ObjectCloner
class CloneableCloner extends java.lang.Object implements ObjectCloner
An object cloner which clones objects that implementCloneable
.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.reflect.Method
CLONE
private java.util.IdentityHashMap<java.lang.Object,java.lang.Object>
clones
private CloneTable
cloneTable
-
Fields inherited from interface org.jboss.marshalling.cloner.ObjectCloner
IDENTITY
-
-
Constructor Summary
Constructors Constructor Description CloneableCloner(ClonerConfiguration configuration)
Create a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone(java.lang.Object orig)
Create a deep clone of the given object.void
reset()
Clear the cloner state and any caches.
-
-
-
Field Detail
-
cloneTable
private final CloneTable cloneTable
-
CLONE
private static final java.lang.reflect.Method CLONE
-
clones
private final java.util.IdentityHashMap<java.lang.Object,java.lang.Object> clones
-
-
Constructor Detail
-
CloneableCloner
CloneableCloner(ClonerConfiguration configuration)
Create a new instance.- Parameters:
configuration
- the configuration
-
-
Method Detail
-
reset
public void reset()
Clear the cloner state and any caches.- Specified by:
reset
in interfaceObjectCloner
-
clone
public java.lang.Object clone(java.lang.Object orig) throws java.io.IOException, java.lang.ClassNotFoundException
Create a deep clone of the given object.- Specified by:
clone
in interfaceObjectCloner
- Parameters:
orig
- the original object- Returns:
- the deep clone
- Throws:
java.io.IOException
- if a serialization error occursjava.lang.ClassNotFoundException
- if a class cannot be loaded during the cloning process
-
-