Specify the method to instantiate objects
represented by this descriptor.
@see #setFactoryClass
777976
private synchronized void setFactoryMethod(Method newMethod)
    {
        if (newMethod != null)
        {
            // make sure it's a no argument method
            if (newMethod.getParameterTypes().length > 0)
            {
                throw new MetadataException(
                    "Factory methods must be zero argument methods: "
                        + newMethod.getClass().getName()
                        + "."
                        + newMethod.getName());
            }

            // make it accessible if it's not already
            if (!newMethod.isAccessible())
            {
                newMethod.setAccessible(true);
            }
        }

        this.factoryMethod = newMethod;
    }
198574
private static void initFactory() {
    if (jsonFactory == null) {
      try {
        // We use reflection because the server side should not
        // depend on gwt-servlet nor gwt-dev. Hence if GWT is not
        // in our classpath means that we are in server side, otherwise
        // we use GWT to figure out if we are running devmode.
        // This is run once, so no performance issues to worry about.
        Class.forName("com.google.gwt.core.shared.GWTBridge");
        Class<?> gwt = Class.forName("com.google.gwt.core.shared.GWT");
        Method method = gwt.getMethod("isClient");
        Object ret = method.invoke(null);
        if (ret instanceof Boolean && ((Boolean) ret)) {
          // We are running DevMode, so create Js versions of the factories
          method = gwt.getMethod("create", Class.class);
          ret = method.invoke(null,
              new Object[] {JsonFactory.class});
          jsonFactory = (JsonFactory) ret;
          ajaxTransport = new AjaxTransportJs();
          return;
        }
      } catch (ClassNotFoundException ignore) {
      } catch (NoSuchMethodException ignore) {
      } catch (SecurityException ignore) {
      } catch (IllegalAccessException ignore) {
      } catch (IllegalArgumentException ignore) {
      } catch (InvocationTargetException ignore) {
      }
      // We are running in the JVM, so create Jre versions.
      jsonFactory = new JsonFactoryJre();
      ajaxTransport = new AjaxTransportJre();
    }
  }
301454
public static DocumentBuilderFactory newInstance(String factoryClassName,
            ClassLoader classLoader) {
        if (factoryClassName == null) {
            throw new FactoryConfigurationError("factoryClassName == null");
        }
        if (classLoader == null) {
            classLoader = Thread.currentThread().getContextClassLoader();
        }
        try {
            Class<?> type = classLoader != null
                    ? classLoader.loadClass(factoryClassName)
                    : Class.forName(factoryClassName);
            return (DocumentBuilderFactory) type.newInstance();
        } catch (ClassNotFoundException e) {
            throw new FactoryConfigurationError(e);
        } catch (InstantiationException e) {
            throw new FactoryConfigurationError(e);
        } catch (IllegalAccessException e) {
            throw new FactoryConfigurationError(e);
        }
    }
444595
public static Object instantiate(Class clazz) throws InstantiationException
    {
        Object result = null;
        try
        {
            result = ClassHelper.newInstance(clazz);
        }
        catch(IllegalAccessException e)
        {
            try
            {
                result = ClassHelper.newInstance(clazz, true);
            }
            catch(Exception e1)
            {
                throw new ClassNotPersistenceCapableException("Can't instantiate class '"
                        + (clazz != null ? clazz.getName() : "null")
                        + "', message was: " + e1.getMessage() + ")", e1);
            }
        }
        return result;
    }
333289
@Override
  public final synchronized void init() throws Exception {
    FactoryBldServices<ResultSet> factoryBldServices =
      new FactoryBldServices<ResultSet>();
    factoryBldServices.setFactoryAppBeans(this);
    setFactoryBldServices(factoryBldServices);
    FactoryReplicatorXmlHttps<ResultSet> factoryReplicatorXmlHttps =
      new FactoryReplicatorXmlHttps<ResultSet>();
    factoryReplicatorXmlHttps.setFactoryAppBeans(this);
    setFactoryReplicatorXmlHttps(factoryReplicatorXmlHttps);
    FactoryDatabaseWriterXml<ResultSet> factoryDatabaseWriterXml =
      new FactoryDatabaseWriterXml<ResultSet>();
    factoryDatabaseWriterXml.setFactoryAppBeans(this);
    setFactoryDatabaseWriterXml(factoryDatabaseWriterXml);
  }
404798
public static void setConverterFactoryClass(Configuration conf,
      Class<? extends ConverterFactory> converterFactoryClass) {
    conf.setClass(CONVERTER_FACTORY, converterFactoryClass, ConverterFactory.class);
    LOG.debug("Set input ConverterFactory class on conf: {}", converterFactoryClass);
  }
510255
public void setObjectClassesForCreate(List<String> objectClasses) {
        if (iRDNObjectClass != null && iRDNObjectClass.length > 1) {
            iObjectClassAttrs = new Attribute[iRDNObjectClass.length];
            for (int i = 0; i < iRDNObjectClass.length; i++) {
                iObjectClassAttrs[i] = new BasicAttribute(LdapConstants.LDAP_ATTR_OBJECTCLASS, iRDNObjectClass[i][0]);
                // Remove the object class for create
                objectClasses.remove(iRDNObjectClass[i][0]);
            }
            // Add rest auxliary object classes.
            for (int i = 0; i < iObjectClassAttrs.length; i++) {
                for (int j = 0; j < objectClasses.size(); j++) {
                    iObjectClassAttrs[i].add(objectClasses.get(j));
                }
            }
        } else {
            iObjectClassAttrs = new Attribute[1];
            iObjectClassAttrs[0] = new BasicAttribute(LdapConstants.LDAP_ATTR_OBJECTCLASS);
            if (objectClasses.size() > 0) {
                for (int i = 0; i < objectClasses.size(); i++) {
                    iObjectClassAttrs[0].add(objectClasses.get(i));
                }
            } else {
                // If create object class is not define, use object classes
                for (int i = 0; i < iObjectClasses.size(); i++) {
                    iObjectClassAttrs[0].add(iObjectClasses.get(i));
                }
            }
        }
    }
761984
function(name, factory, object) {

                        var that = this;
                        var objects = this._resolveObjects(name, factory, object);

                        _.each(objects, function(factoryObjects, factory) {
                            _.each(factoryObjects, function(object, name) {
                                that._setObjectCreator([name], that._createObjectCreator(factory, object));
                            });
                        });

                        return this;
                    }
6178
public static void initClass() {

        // registers a factory for creating new instances of this widget
        CmsWidgetFactoryRegistry.instance().registerFactory(WIDGET_TYPE, new I_CmsFormWidgetFactory() {

            /**
             * @see org.opencms.gwt.client.ui.input.form.I_CmsFormWidgetFactory#createWidget(java.util.Map, com.google.common.base.Optional)
             */
            public I_CmsFormWidget createWidget(Map<String, String> widgetParams, Optional<String> defaultValue) {

                Map<String, CmsPair<String, Boolean>> entries = new HashMap<String, CmsPair<String, Boolean>>();
                String label = "Select";
                if (widgetParams.containsKey("label")) {
                    label = widgetParams.get("label");
                    widgetParams.remove("label");
                }
                for (Map.Entry<String, String> entry : widgetParams.entrySet()) {
                    entries.put(entry.getKey(), CmsPair.create(entry.getValue(), Boolean.FALSE));
                }
                CmsMultiSelectCell cell = new CmsMultiSelectCell(entries);
                cell.setOpenerText(label);
                CmsMultiSelectBox box = new CmsMultiSelectBox();
                box.addOption(cell);
                return box;
            }
        });
    }
90294
public static void setConnectionFactory(final ConnectionFactory connectionFactory) {
    if (connectionFactory == null)
      CONNECTION_FACTORY = ConnectionFactory.DEFAULT;
    else
      CONNECTION_FACTORY = connectionFactory;
  }
52963
public void setCombinerClass(Class<? extends Reducer> cls
                               ) throws IllegalStateException {
    ensureState(JobState.DEFINE);
    conf.setClass(COMBINE_CLASS_ATTR, cls, Reducer.class);
  }
348465
protected void configureEndpointFactory(AbstractWSDLBasedEndpointFactory factory)
   {
      //Configure binding customization
      if (customization != null)
      {
         ReflectionServiceFactoryBean serviceFactory = factory.getServiceFactory();
         //customize default databinding (early pulls in ServiceFactory default databinding and configure it, as it's lazily loaded)
         serviceFactory.reset();
         DataBinding serviceFactoryDataBinding = serviceFactory.getDataBinding(true);
         configureBindingCustomization(serviceFactoryDataBinding, customization);
         serviceFactory.setDataBinding(serviceFactoryDataBinding);
         //customize user provided databinding (CXF later overrides the ServiceFactory databinding using the user provided one) 
         if (factory.getDataBinding() == null)
         {
            //set the endpoint factory's databinding to prevent CXF resetting everything because user did not provide anything
            factory.setDataBinding(serviceFactoryDataBinding);
         }
         else
         {
            configureBindingCustomization(factory.getDataBinding(), customization);
         }
      }
      //add other configurations here below
   }
752969
def instantiate(self, cls=None):
        
        if cls is None:
            cls = self.cls
        if cls is None:
            raise TypeError("cls must a class")
        return cls.create(*self.args, **self.kwargs)
442680
public void setClazz(Class<? extends ElementBase> clazz) {
        this.clazz = clazz;

        try {
            // Force execution of static initializers
            Class.forName(clazz.getName());
        } catch (ClassNotFoundException e) {
            MiscUtil.toUnchecked(e);
        }
    }
1134439
public final void setEntryViewFactory(
            Callback<Entry<?>, AllDayEntryView> factory) {
        requireNonNull(factory);
        entryViewFactoryProperty().set(factory);
    }
989308
private void setNewObjectMapper() {
        mapper = new ObjectMapper();
        if (!serializeNullValues) {
            mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
            if (ignoreUnknownProperties) {
                mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
            }
        }
    }
218315
private static void createFactoryInstance() throws Exception {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createFactoryInstance");
    try {
      Class cls = Class.forName(MfpConstants.JS_JMS_MESSAGE_FACTORY_CLASS);
      instance = (JsJmsMessageFactory) cls.newInstance();
    }
    catch (Exception e) {
      FFDCFilter.processException(e, "com.ibm.ws.sib.mfp.JsJmsMessageFactory.createFactoryInstance", "133");
      SibTr.error(tc,"UNABLE_TO_CREATE_JMSFACTORY_CWSIF0011",e);
      throw e;
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createFactoryInstance");
  }