--- FACTORY METHOD ---
779886
@Override
	public <T extends Endpoint> Strategy<T> create() {
		return new NanoSecRandomStrategy<T>(broker, preferLocal);
	}
946489
static Converter createDefaultConverter() {
        List<NodeFactory> factories;
        String property = System.getProperty(LIBRARIES_PROPERTY_NAME);

        if (property != null && property.trim().length() > 0) {
            factories = createFactoriesSpecifiedInProperty(property);
        } else {
            factories = createDefaultFactories();
        }

        if (factories.isEmpty()) {
            throw new IllegalStateException("Please add either json.org, Jackson 1.x, Jackson 2.x or Gson to the classpath");
        }
        return new Converter(factories);
    }
1345287
protected final MailConnectionFactory createMailConnectionFactoryImpl(String className)
    {
        String factoryClassName=className;
        if(factoryClassName==null)
        {
            factoryClassName=MailConnectionFactoryImpl.class.getName();
        }

        //create new instance
        MailConnectionFactory factory=(MailConnectionFactory)ReflectionHelper.createInstance(factoryClassName);
            
        //initialize
        factory.initialize(this);
        
        return factory;
    }
484752
protected final FactorySimple
    createPutFactorySimple(
      final Class<?> pBeanClass) throws Exception {
    FactorySimple factory = new FactorySimple();
    factory.setObjectClass(pBeanClass);
    //assigning fully initialized object:
    this.factoriesMap
      .put(pBeanClass, factory);
    return factory;
  }
628411
protected final FactoryPersistableBase
    createPutFactoryPersistableBase(
      final Class<?> pBeanClass) throws Exception {
    FactoryPersistableBase factory = new FactoryPersistableBase();
    factory.setObjectClass(pBeanClass);
    factory.setDatabaseId(this.srvDatabase.getIdDatabase());
    //assigning fully initialized object:
    this.factoriesMap
      .put(pBeanClass, factory);
    return factory;
  }
539238
public ProductFactoryCascade<T> addFactoryBefore(ProductFactory<? extends T> factory) {
		ArrayList<ProductFactory<? extends T>> factories = new ArrayList<ProductFactory<? extends T>>(this.factories.size()+1);
		factories.addAll(this.factories);
		factories.add(0, factory);
		return new ProductFactoryCascade<>(factories);
	}
1017071
public BuildableType.Builder builderFactory(BuilderFactory builderFactory) {
    this.builderFactory = Objects.requireNonNull(builderFactory);
    _unsetProperties.remove(Property.BUILDER_FACTORY);
    return (BuildableType.Builder) this;
  }
638053
public static <T> RuntimeTypeAdapterFactory<T> of(Class<T> baseType) {
    return new RuntimeTypeAdapterFactory<T>(baseType, "type", false);
  }
1151949
@Override
    public Collection<MonetaryAmountFactory<?>> getAmountFactories(MonetaryAmountFactoryQuery factoryQuery){
        Objects.requireNonNull(factoryQuery);
        List<MonetaryAmountFactory<?>> factories = new ArrayList<>();
        // first check for explicit type
        for(@SuppressWarnings("unchecked") MonetaryAmountFactoryProviderSpi<? extends MonetaryAmount> factory : Bootstrap
                .getServices(MonetaryAmountFactoryProviderSpi.class)){
            if(factory.getQueryInclusionPolicy() == QueryInclusionPolicy.NEVER){
                continue;
            }
            if(factoryQuery.getTargetType() == factory.getAmountType()){
                if(isPrecisionOK(factoryQuery, factory.getMaximalMonetaryContext())){
                    factories.add(factory.createMonetaryAmountFactory());
                }else{
                    throw new MonetaryException("Incompatible context required=" + factoryQuery + ", maximal=" +
                                                        factory.getMaximalMonetaryContext());
                }
            }
        }
        List<MonetaryAmountFactoryProviderSpi<? extends MonetaryAmount>> selection = new ArrayList<>();
        for(@SuppressWarnings("unchecked") MonetaryAmountFactoryProviderSpi<? extends MonetaryAmount> factory : Bootstrap
                .getServices(MonetaryAmountFactoryProviderSpi.class)){
            if(factory.getQueryInclusionPolicy() == QueryInclusionPolicy.DIRECT_REFERENCE_ONLY ||
                    factory.getQueryInclusionPolicy() == QueryInclusionPolicy.NEVER){
                continue;
            }
            if(isPrecisionOK(factoryQuery, factory.getMaximalMonetaryContext())){
                selection.add(factory);
            }
        }
        if(selection.isEmpty()){
            // fall back, add all selections, ignore flavor
            for(@SuppressWarnings("unchecked") MonetaryAmountFactoryProviderSpi<? extends MonetaryAmount> factory : Bootstrap
                    .getServices(MonetaryAmountFactoryProviderSpi.class)){
                if(factory.getQueryInclusionPolicy() == QueryInclusionPolicy.DIRECT_REFERENCE_ONLY ||
                        factory.getQueryInclusionPolicy() == QueryInclusionPolicy.NEVER){
                    continue;
                }
                if(isPrecisionOK(factoryQuery, factory.getMaximalMonetaryContext())){
                    selection.add(factory);
                }
            }
        }
        if(selection.size() == 1){
            factories.add(selection.get(0).createMonetaryAmountFactory());
        }

		MonetaryContext context = createContext(factoryQuery);

		factories.forEach(f -> f.setContext(context));
        selection.sort(CONTEXT_COMPARATOR);
        factories.add(selection.get(0).createMonetaryAmountFactory());
        return factories;
    }
1078390
public static DataCoding newInstance(byte dataCoding) {
        for (DataCodingFactory factory : factories) {
            if (factory.isRecognized(dataCoding)) {
                return factory.newInstance(dataCoding);
            }
        }
        return new RawDataCoding(dataCoding);
    }
355281
@Override
  public final synchronized void init() throws Exception {
    FactoryBldAccServices<ResultSet> factoryBldAccServices =
      new FactoryBldAccServices<ResultSet>();
    factoryBldAccServices.setFactoryAppBeans(this);
    setFactoryBldServices(factoryBldAccServices);
    FactoryAccServices<ResultSet> factoryAccServices =
      new FactoryAccServices<ResultSet>();
    factoryAccServices.setFactoryAppBeans(this);
    factoryAccServices.setFactoryBldAccServices(factoryBldAccServices);
    factoryBldAccServices.setFactoryAccServices(factoryAccServices);
    setFactoryOverBeans(factoryAccServices);
    FactoryAccReplicatorXmlHttps<ResultSet> factoryReplicatorXmlHttps =
      new FactoryAccReplicatorXmlHttps<ResultSet>();
    factoryReplicatorXmlHttps.setFactoryAppBeans(this);
    setFactoryReplicatorXmlHttps(factoryReplicatorXmlHttps);
    FactoryAccDatabaseWriterXml<ResultSet> factoryDatabaseWriterXml =
      new FactoryAccDatabaseWriterXml<ResultSet>();
    factoryDatabaseWriterXml.setFactoryAppBeans(this);
    setFactoryDatabaseWriterXml(factoryDatabaseWriterXml);
  }
903168
def factory(arg1, arg2, version=-1, forceviewserveruse=False, windowId=None, uiAutomatorHelper=None):
        '''
        
        '''

        if DEBUG_VIEW_FACTORY:
            print >> sys.stderr, "View.factory(%s, %s, %s, %s, %s, %s)" % (arg1, arg2, version, forceviewserveruse, windowId, uiAutomatorHelper)
        if type(arg1) == types.ClassType:
            cls = arg1
            attrs = None
        else:
            cls = None
            attrs = arg1
        if isinstance(arg2, View):
            view = arg2
            device = None
        else:
            device = arg2
            view = None

        if attrs and attrs.has_key('class'):
            clazz = attrs['class']
            if DEBUG_VIEW_FACTORY:
                print >> sys.stderr, "    View.factory: creating View with specific class: %s" % clazz
            if clazz == 'android.widget.TextView':
                return TextView(attrs, device, version, forceviewserveruse, windowId, uiAutomatorHelper)
            elif clazz == 'android.widget.EditText':
                return EditText(attrs, device, version, forceviewserveruse, windowId, uiAutomatorHelper)
            elif clazz == 'android.widget.ListView':
                return ListView(attrs, device, version, forceviewserveruse, windowId, uiAutomatorHelper)
            else:
                return View(attrs, device, version, forceviewserveruse, windowId, uiAutomatorHelper)
        elif cls:
            if view:
                return cls.__copy(view)
            else:
                return cls(attrs, device, version, forceviewserveruse, windowId, uiAutomatorHelper)
        elif view:
            return copy.copy(view)
        else:
            if DEBUG_VIEW_FACTORY:
                print >> sys.stderr, "    View.factory: creating generic View"
            return View(attrs, device, version, forceviewserveruse, windowId, uiAutomatorHelper)
199838
public FacesConfigFactoryType<WebFacesConfigDescriptor> getOrCreateFactory()
   {
      List<Node> nodeList = model.get("factory");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FacesConfigFactoryTypeImpl<WebFacesConfigDescriptor>(this, "factory", model, nodeList.get(0));
      }
      return createFactory();
   }
809342
public ComponentFactory<T, E> toCreate(BiFunction<Constructor, Object[], Object>
                                             createFunction) {
    return new ComponentFactory<>(this.annotationType, this.classElement, this.contextConsumer, createFunction);
  }
298001
private static void createFactoryInstance()
  {
    try {
      Class cls = Class.forName(MP_MESSAGE_SELECTOR_FACTORY_CLASS);
      instance = (MPSelectionCriteriaFactory) cls.newInstance();
    }
    catch (Exception e) {
      FFDCFilter.processException(e, "com.ibm.ws.sib.processor.MPSelectionCriteriaFactory.createFactoryInstance", "100");
      throw new SIErrorException(e);
    }
  }
1168796
public static FormatFactory factory()
    {

        return new FormatFactory()
        {
            @Override
            public Format getFormat(String name, String args, Locale locale)
            {
                Map<String, Format> mt = FormatTables.get(name);
                Preconditions.checkArgument(mt != null, "There's no format instance for [%s]", name);

                Format m = mt.get((args == null || args.length() < 1) ? FormatNames.DEFAULT : args);
                Preconditions.checkArgument(m != null, "There's no signature in [%s] for the given args [%s]", name,
                        args);

                return ((ConfigurableFormat) m).withLocale(locale);
            }
        };

    }
379251
@FactoryMethod
    public static OgnlExpectation create( String expected )
    {

        if (!OgnlExpectation.conditionalExpression( expected ) &&
            !OgnlExpectation.extractExpression( expected )) return null;
        return new OgnlExpectation( expected );
    }