Class MultiArgInstantiationPolicy
- java.lang.Object
-
- org.eclipse.persistence.internal.core.descriptors.CoreInstantiationPolicy
-
- org.eclipse.persistence.internal.descriptors.InstantiationPolicy
-
- org.eclipse.persistence.internal.jaxb.MultiArgInstantiationPolicy
-
- All Implemented Interfaces:
Serializable
,Cloneable
public class MultiArgInstantiationPolicy extends InstantiationPolicy
Purpose: Provide a version of Instantiation Policy that can make use of a multiple argument factory method. The defaultValues specified on this policy will be passed in to the factory method for the parameter values. This is required for certain JAXB generated classes that have no 0 arg constructor and a factory method with multiple arguments.- Author:
- mmacivor
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.internal.descriptors.InstantiationPolicy
descriptor, factory, factoryClass, factoryClassName, factoryMethodName, method, methodName
-
-
Constructor Summary
Constructors Constructor Description MultiArgInstantiationPolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Object
buildNewInstanceUsingFactory()
Build and return a new instance, using the factory.void
convertClassNamesToClasses(ClassLoader loader)
protected void
initializeMethod()
void
setDefaultValues(Object[] values)
void
setParameterTypeNames(String[] parameterTypeNames)
void
setParameterTypes(Class[] parameterTypes)
-
Methods inherited from class org.eclipse.persistence.internal.descriptors.InstantiationPolicy
buildDefaultConstructor, buildDefaultConstructorFor, buildFactory, buildFactoryDefaultConstructor, buildFactoryUsingDefaultConstructor, buildFactoryUsingStaticMethod, buildMethod, buildNewInstance, buildNewInstanceUsingDefaultConstructor, clone, getDefaultConstructor, getDescriptor, getFactory, getFactoryClass, getFactoryClassName, getFactoryMethodName, getMethod, getMethodName, initialize, isUsingDefaultConstructor, setDefaultConstructor, setDescriptor, setFactory, setFactoryClass, setFactoryClassName, setFactoryMethodName, setMethod, setMethodName, toString, useDefaultConstructorInstantiationPolicy, useFactoryInstantiationPolicy, useFactoryInstantiationPolicy, useFactoryInstantiationPolicy, useFactoryInstantiationPolicy, useFactoryInstantiationPolicy, useMethodInstantiationPolicy
-
-
-
-
Method Detail
-
setParameterTypeNames
public void setParameterTypeNames(String[] parameterTypeNames)
-
setParameterTypes
public void setParameterTypes(Class[] parameterTypes)
-
setDefaultValues
public void setDefaultValues(Object[] values)
-
convertClassNamesToClasses
public void convertClassNamesToClasses(ClassLoader loader)
- Overrides:
convertClassNamesToClasses
in classInstantiationPolicy
-
initializeMethod
protected void initializeMethod() throws DescriptorException
- Overrides:
initializeMethod
in classInstantiationPolicy
- Throws:
DescriptorException
-
buildNewInstanceUsingFactory
protected Object buildNewInstanceUsingFactory() throws DescriptorException
Build and return a new instance, using the factory. The factory can be null, in which case the method is a static method defined by the descriptor class.- Overrides:
buildNewInstanceUsingFactory
in classInstantiationPolicy
- Throws:
DescriptorException
-
-