Class MultiArgInstantiationPolicy

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public class MultiArgInstantiationPolicy
    extends org.eclipse.persistence.internal.descriptors.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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.Object buildNewInstanceUsingFactory()
      Build and return a new instance, using the factory.
      void convertClassNamesToClasses​(java.lang.ClassLoader loader)  
      protected void initializeMethod()  
      void setDefaultValues​(java.lang.Object[] values)  
      void setParameterTypeNames​(java.lang.String[] parameterTypeNames)  
      void setParameterTypes​(java.lang.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
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MultiArgInstantiationPolicy

        public MultiArgInstantiationPolicy()
    • Method Detail

      • setParameterTypeNames

        public void setParameterTypeNames​(java.lang.String[] parameterTypeNames)
      • setParameterTypes

        public void setParameterTypes​(java.lang.Class[] parameterTypes)
      • setDefaultValues

        public void setDefaultValues​(java.lang.Object[] values)
      • convertClassNamesToClasses

        public void convertClassNamesToClasses​(java.lang.ClassLoader loader)
        Overrides:
        convertClassNamesToClasses in class org.eclipse.persistence.internal.descriptors.InstantiationPolicy
      • initializeMethod

        protected void initializeMethod()
                                 throws org.eclipse.persistence.exceptions.DescriptorException
        Overrides:
        initializeMethod in class org.eclipse.persistence.internal.descriptors.InstantiationPolicy
        Throws:
        org.eclipse.persistence.exceptions.DescriptorException
      • buildNewInstanceUsingFactory

        protected java.lang.Object buildNewInstanceUsingFactory()
                                                         throws org.eclipse.persistence.exceptions.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 class org.eclipse.persistence.internal.descriptors.InstantiationPolicy
        Throws:
        org.eclipse.persistence.exceptions.DescriptorException