Class ClassCopierOrdinaryImpl.ConstructorFactory

java.lang.Object
org.glassfish.pfl.dynamic.copyobject.impl.ClassCopierOrdinaryImpl.ConstructorFactory
Enclosing class:
ClassCopierOrdinaryImpl

private abstract static class ClassCopierOrdinaryImpl.ConstructorFactory extends Object
Class used as a factory for the appropriate Serialization constructors. Note that this cannot be exposed in another class (even package private), because this would provide access to a constructor in some cases that can never be used outside of special serialization or copy support.
  • Constructor Details

    • ConstructorFactory

      private ConstructorFactory()
  • Method Details

    • getExternalizableConstructor

      private static Constructor<?> getExternalizableConstructor(Class<?> cl)
      Returns public no-arg constructor of given class, or null if none found. Access checks are disabled on the returned constructor (if any), since the defining class may still be non-public.

    • getSerializableConstructor

      private static Constructor<?> getSerializableConstructor(Class<?> clazz)
      Returns subclass-accessible no-arg constructor of first non-serializable superclass, or null if none found. Access checks are disabled on the returned constructor (if any).

    • getDefaultConstructor

      private static Constructor<?> getDefaultConstructor(Class<?> clazz)
      Returns a constructor based on the first no-args constructor in the super class chain. This allows us to construct an instance of any class at all, serializable or not.
    • makeConstructor

      private static Constructor<?> makeConstructor(Class<?> cls)
      Analyze the class to determine the correct constructor type. Returns the appropriate constructor.