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