Class ClassCopierOrdinaryImpl.ConstructorFactory
- java.lang.Object
-
- org.glassfish.pfl.dynamic.copyobject.impl.ClassCopierOrdinaryImpl.ConstructorFactory
-
- Enclosing class:
- ClassCopierOrdinaryImpl
private abstract static class ClassCopierOrdinaryImpl.ConstructorFactory extends java.lang.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 Summary
Constructors Modifier Constructor Description private
ConstructorFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.lang.reflect.Constructor<?>
getDefaultConstructor(java.lang.Class<?> clazz)
Returns a constructor based on the first no-args constructor in the super class chain.private static java.lang.reflect.Constructor<?>
getExternalizableConstructor(java.lang.Class<?> cl)
Returns public no-arg constructor of given class, or null if none found.private static java.lang.reflect.Constructor<?>
getSerializableConstructor(java.lang.Class<?> clazz)
Returns subclass-accessible no-arg constructor of first non-serializable superclass, or null if none found.private static java.lang.reflect.Constructor<?>
makeConstructor(java.lang.Class<?> cls)
Analyze the class to determine the correct constructor type.
-
-
-
Method Detail
-
getExternalizableConstructor
private static java.lang.reflect.Constructor<?> getExternalizableConstructor(java.lang.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 java.lang.reflect.Constructor<?> getSerializableConstructor(java.lang.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 java.lang.reflect.Constructor<?> getDefaultConstructor(java.lang.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 java.lang.reflect.Constructor<?> makeConstructor(java.lang.Class<?> cls)
Analyze the class to determine the correct constructor type. Returns the appropriate constructor.
-
-