Class SCloner


  • public class SCloner
    extends java.lang.Object
    Deep cloner.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected static class  SCloner.CloneContext
      Extendable clone context.
    • Constructor Summary

      Constructors 
      Constructor Description
      SCloner()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Object clone​(java.lang.Object object)
      Clones an object using object traversal.
      static java.lang.Object clone​(java.lang.Object object, Traverser traverser, java.util.List<ITraverseProcessor> processors, java.lang.ClassLoader targetcl)
      Clones an object using object traversal.
      static java.lang.Object clone​(java.lang.Object object, java.lang.ClassLoader targetcl)
      Clones an object using object traversal.
      static java.lang.Object clone​(java.lang.Object object, java.util.List<ITraverseProcessor> processors)
      Clones an object using object traversal.
      static java.lang.Object createBeanObject​(IBeanIntrospector intro, java.lang.Class<?> clazz)
      Creates a bean object from class.
      static boolean isCloneContext​(java.lang.Object context)
      Check if a context is a clone contexxt.
      • Methods inherited from class java.lang.Object

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

      • SCloner

        public SCloner()
    • Method Detail

      • isCloneContext

        public static final boolean isCloneContext​(java.lang.Object context)
        Check if a context is a clone contexxt.
        Parameters:
        context - The context.
        Returns:
        True, if context is a clone context.
      • clone

        public static final java.lang.Object clone​(java.lang.Object object)
        Clones an object using object traversal.
        Parameters:
        object - Original object.
        Returns:
        Cloned object.
      • clone

        public static final java.lang.Object clone​(java.lang.Object object,
                                                   java.util.List<ITraverseProcessor> processors)
        Clones an object using object traversal.
        Parameters:
        object - Original object.
        Returns:
        Cloned object.
      • clone

        public static final java.lang.Object clone​(java.lang.Object object,
                                                   java.lang.ClassLoader targetcl)
        Clones an object using object traversal.
        Parameters:
        object - Original object
        targetcl - ClassLoader if different from original.
        Returns:
        Cloned object.
      • clone

        public static final java.lang.Object clone​(java.lang.Object object,
                                                   Traverser traverser,
                                                   java.util.List<ITraverseProcessor> processors,
                                                   java.lang.ClassLoader targetcl)
        Clones an object using object traversal.
        Parameters:
        object - Original object
        targetcl - ClassLoader if different from original.
        Returns:
        Cloned object.
      • createBeanObject

        public static final java.lang.Object createBeanObject​(IBeanIntrospector intro,
                                                              java.lang.Class<?> clazz)
        Creates a bean object from class.
        Parameters:
        intro - Bean introspector to use.
        clazz - The class.
        Returns:
        Instantiated bean object.