Class CloneableCloner

  • All Implemented Interfaces:
    ObjectCloner

    class CloneableCloner
    extends java.lang.Object
    implements ObjectCloner
    An object cloner which clones objects that implement Cloneable.
    • 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  
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • 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 interface ObjectCloner
      • 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 interface ObjectCloner
        Parameters:
        orig - the original object
        Returns:
        the deep clone
        Throws:
        java.io.IOException - if a serialization error occurs
        java.lang.ClassNotFoundException - if a class cannot be loaded during the cloning process