Interface ObjectCloner

  • All Known Implementing Classes:
    CloneableCloner, SerializingCloner

    public interface ObjectCloner
    An object cloner. Creates a (possibly deep) clone of an object. Unlike Marshallers and Unmarshallers, ObjectCloners are thread-safe and can be used to clone object graphs concurrently.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static ObjectCloner IDENTITY
      The identity object cloner.
    • Method Summary

      All Methods Instance Methods Abstract 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

      • IDENTITY

        static final ObjectCloner IDENTITY
        The identity object cloner. Always returns the same object it is given.
    • Method Detail

      • reset

        void reset()
        Clear the cloner state and any caches.
      • clone

        java.lang.Object clone​(java.lang.Object orig)
                        throws java.io.IOException,
                               java.lang.ClassNotFoundException
        Create a deep clone of the given object.
        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