org.glassfish.pfl.dynamic.copyobject.spi
Class CopyobjectDefaults

java.lang.Object
  extended by org.glassfish.pfl.dynamic.copyobject.spi.CopyobjectDefaults

public abstract class CopyobjectDefaults
extends Object


Method Summary
static ObjectCopierFactory getReferenceObjectCopierFactory()
          Obtain the reference object "copier".
static ObjectCopierFactory makeFallbackObjectCopierFactory(ObjectCopierFactory f1, ObjectCopierFactory f2)
          Create a fallback copier factory from the two ObjectCopierFactory arguments.
static ObjectCopierFactory makeJavaStreamObjectCopierFactory()
           
static ObjectCopierFactory makeReflectObjectCopierFactory()
          Obtain the new reflective copier factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

makeJavaStreamObjectCopierFactory

public static ObjectCopierFactory makeJavaStreamObjectCopierFactory()

getReferenceObjectCopierFactory

public static ObjectCopierFactory getReferenceObjectCopierFactory()
Obtain the reference object "copier". This does no copies: it just returns whatever is passed to it.


makeFallbackObjectCopierFactory

public static ObjectCopierFactory makeFallbackObjectCopierFactory(ObjectCopierFactory f1,
                                                                  ObjectCopierFactory f2)
Create a fallback copier factory from the two ObjectCopierFactory arguments. This copier makes an ObjectCopierFactory that creates instances of a fallback copier that first tries an ObjectCopier created from f1, then tries one created from f2, if the first throws a ReflectiveCopyException.


makeReflectObjectCopierFactory

public static ObjectCopierFactory makeReflectObjectCopierFactory()
Obtain the new reflective copier factory. This is 3-4 times faster than the stream copier, and about 10% faster than the old reflective copier. It should normally be used with a fallback copier, as there are some classes that simply cannot be copied reflectively.



Copyright © 2013 Oracle. All Rights Reserved.