Class DeepCloner.UnsafeFieldWriter

  • Enclosing class:
    DeepCloner

    private static class DeepCloner.UnsafeFieldWriter
    extends java.lang.Object
    Most of this code has been copied from the Sun14ReflectionProvider in the XStream project. Some changes has been made, namely if the field is static final then the Unsafe.staticFieldOffset(Field) method is used instead of Unsafe.objectFieldOffset(Field).
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.Exception exception  
      private static sun.misc.Unsafe unsafe  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private UnsafeFieldWriter()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void write​(java.lang.reflect.Field field, java.lang.Object object, java.lang.Object value)  
      • Methods inherited from class java.lang.Object

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

      • unsafe

        private static final sun.misc.Unsafe unsafe
      • exception

        private static final java.lang.Exception exception
    • Constructor Detail

      • UnsafeFieldWriter

        private UnsafeFieldWriter()
    • Method Detail

      • write

        public static void write​(java.lang.reflect.Field field,
                                 java.lang.Object object,
                                 java.lang.Object value)