Creates the default factory implementation.
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated
10248
public static ColorFactory init() {
		try {
			ColorFactory theColorFactory = (ColorFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.omg.org/spec/BPMN/non-normative/color"); 
			if (theColorFactory != null) {
				return theColorFactory;
			}
		}
		catch (Exception exception) {
			EcorePlugin.INSTANCE.log(exception);
		}
		return new ColorFactoryImpl();
	}
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);
    }
1327678
public function factory()
    {

        // register additional annotation libraries
        foreach ($this->persistenceUnitNode->getAnnotationRegistries() as $annotationRegistry) {
            AnnotationRegistry::registerAutoloadNamespace(
                $annotationRegistry->getNamespace(),
                $annotationRegistry->getDirectoriesAsArray($this->application->getWebappPath())
            );
        }

        // globally ignore configured annotations to ignore
        foreach ($this->persistenceUnitNode->getIgnoredAnnotations() as $ignoredAnnotation) {
            AnnotationReader::addGlobalIgnoredName($ignoredAnnotation->getNodeValue()->__toString());
        }

        // load the metadata configuration
        $metadataConfiguration = $this->persistenceUnitNode->getMetadataConfiguration();

        // prepare the setup properties
        $absolutePaths = $metadataConfiguration->getDirectoriesAsArray($this->application->getWebappPath());
        $proxyDir = $metadataConfiguration->getParam(MetadataConfigurationInterface::PARAM_PROXY_DIR);
        $isDevMode = $metadataConfiguration->getParam(MetadataConfigurationInterface::PARAM_IS_DEV_MODE);
        $useSimpleAnnotationReader = $metadataConfiguration->getParam(MetadataConfigurationInterface::PARAM_USE_SIMPLE_ANNOTATION_READER);

        // load the factory method from the available mappings
        $factoryMethod = EntityManagerFactory::$metadataMapping[$metadataConfiguration->getType()];

        // create the database configuration and initialize the entity manager
        $configuration = Setup::$factoryMethod($absolutePaths, $isDevMode, $proxyDir, null, $useSimpleAnnotationReader);

        // load the datasource node
        $datasourceNode = null;
        foreach ($this->application->getInitialContext()->getSystemConfiguration()->getDatasources() as $datasourceNode) {
            if ($datasourceNode->getName() === $this->persistenceUnitNode->getDatasource()->getName()) {
                break;
            }
        }

        // throw a exception if the configured datasource is NOT available
        if ($datasourceNode == null) {
            throw new \Exception(
                sprintf(
                    'Can\'t find a datasource node for persistence unit %s',
                    $this->persistenceUnitNode->getName()
                )
            );
        }

        // load the database node
        $databaseNode = $datasourceNode->getDatabase();

        // throw an exception if the configured database is NOT available
        if ($databaseNode == null) {
            throw new \Exception(
                sprintf(
                    'Can\'t find database node for persistence unit %s',
                    $this->persistenceUnitNode->getName()
                )
            );
        }

        // load the driver node
        $driverNode = $databaseNode->getDriver();

        // throw an exception if the configured driver is NOT available
        if ($driverNode == null) {
            throw new \Exception(
                sprintf(
                    'Can\'t find driver node for persistence unit %s',
                    $this->persistenceUnitNode->getName()
                )
            );
        }

        // initialize and return a entity manager decorator instance
        return new DoctrineEntityManagerDecorator(
            EntityManager::create(ConnectionUtil::get($this->application)->fromDatabaseNode($databaseNode), $configuration)
        );
    }
140581
private XMLInputFactory factory() {
        XMLInputFactory factory = XMLInputFactory.newInstance();
        factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);
        factory.setProperty(XMLInputFactory.SUPPORT_DTD, false);
        return factory;
    }
182839
public static LogFactory init() {
		try {
			LogFactory theLogFactory = (LogFactory) EPackage.Registry.INSTANCE.getEFactory(LogPackage.eNS_URI);
			if (theLogFactory != null) {
				return theLogFactory;
			}
		} catch (Exception exception) {
			EcorePlugin.INSTANCE.log(exception);
		}
		return new LogFactoryImpl();
	}
554160
static final synchronized CryptoSuiteFactory getDefault() throws ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException {

        if (null == theFACTORY) {

            String cf = config.getDefaultCryptoSuiteFactory();
            if (null == cf || cf.isEmpty() || cf.equals(HLSDKJCryptoSuiteFactory.class.getName())) { // Use this class as the factory.

                theFACTORY = HLSDKJCryptoSuiteFactory.instance();

            } else {

                // Invoke static method instance on factory class specified by config properties.
                // In this case this class will no longer be used as the factory.

                Class<?> aClass = Class.forName(cf);

                Method method = aClass.getMethod("instance");
                Object theFACTORYObject = method.invoke(null);
                if (null == theFACTORYObject) {
                    throw new InstantiationException(String.format("Class specified by %s has instance method returning null.  Expected object implementing CryptoSuiteFactory interface.", cf));
                }

                if (!(theFACTORYObject instanceof CryptoSuiteFactory)) {

                    throw new InstantiationException(String.format("Class specified by %s has instance method returning a class %s which does not implement interface CryptoSuiteFactory ",
                            cf, theFACTORYObject.getClass().getName()));

                }

                theFACTORY = (CryptoSuiteFactory) theFACTORYObject;

            }
        }

        return theFACTORY;
    }
4793
@Nonnull
  public static DocumentBuilderFactory createDefaultDocumentBuilderFactory ()
  {
    final DocumentBuilderFactory aDocumentBuilderFactory = DocumentBuilderFactory.newInstance ();
    aDocumentBuilderFactory.setNamespaceAware (DEFAULT_DOM_NAMESPACE_AWARE);
    aDocumentBuilderFactory.setValidating (DEFAULT_DOM_VALIDATING);
    aDocumentBuilderFactory.setIgnoringElementContentWhitespace (DEFAULT_DOM_IGNORING_ELEMENT_CONTENT_WHITESPACE);
    aDocumentBuilderFactory.setExpandEntityReferences (DEFAULT_DOM_EXPAND_ENTITY_REFERENCES);
    aDocumentBuilderFactory.setIgnoringComments (DEFAULT_DOM_IGNORING_COMMENTS);
    aDocumentBuilderFactory.setCoalescing (DEFAULT_DOM_COALESCING);
    try
    {
      // Set secure processing to be the default. This is anyway the default in
      // JDK8
      aDocumentBuilderFactory.setFeature (EXMLParserFeature.SECURE_PROCESSING.getName (), true);
    }
    catch (final ParserConfigurationException ex1)
    {
      // Ignore
    }
    try
    {
      aDocumentBuilderFactory.setXIncludeAware (DEFAULT_DOM_XINCLUDE_AWARE);
    }
    catch (final UnsupportedOperationException ex)
    {
      // Ignore
    }
    return aDocumentBuilderFactory;
  }
792034
public static Factory newInstance() {
        ScheduledExecutorService scheduler = newSingleThreadScheduledExecutor(new ThreadFactory() {
            public Thread newThread(Runnable r) {
                Thread result = new Thread(r);
                result.setDaemon(true);
                return result;
            }
        });
        Properties props = new Properties();
        return new DefaultFactory(scheduler, props);
    }
935024
public AbstractModule createModule() {
        return new AbstractModule() {
            @Override
            protected void configure() {
                bind(IDataFactory.class).to(mDataFacClass);
                bind(IMetaEntryFactory.class).to(mMetaFacClass);
                bind(IRevisioning.class).to(mRevisioningClass);
                bind(IByteHandlerPipeline.class).toInstance(mByteHandler);
                install(new FactoryModuleBuilder().implement(IBackend.class, mBackend).build(
                    IBackendFactory.class));
                install(new FactoryModuleBuilder().build(IResourceConfigurationFactory.class));
                bind(Key.class).toInstance(mKey);
                install(new FactoryModuleBuilder().build(ISessionConfigurationFactory.class));
            }
        };
    }
1143623
protected function createObjectFactory()
    {
        try {
            if (isset($this->parameters[SessionParameter::OBJECT_FACTORY_CLASS])) {
                $objectFactoryClass = new $this->parameters[SessionParameter::OBJECT_FACTORY_CLASS];
            } else {
                $objectFactoryClass = $this->createDefaultObjectFactoryInstance();
            }

            if (!($objectFactoryClass instanceof ObjectFactoryInterface)) {
                throw new \RuntimeException('Class does not implement ObjectFactoryInterface!', 1408354119);
            }

            $objectFactoryClass->initialize($this, $this->parameters);

            return $objectFactoryClass;
        } catch (\Exception $exception) {
            throw new \RuntimeException(
                'Unable to create object factory: ' . $exception,
                1408354120
            );
        }
    }
926403
public static ServletContainer defaultContainer() {
        if (container != null) {
            return container;
        }
        synchronized (Servlets.class) {
            if (container != null) {
                return container;
            }
            return container = ServletContainer.Factory.newInstance();
        }
    }
237668
protected function createFactory()
    {
        $factory = Str::studly(class_basename($this->argument('name')));

        $this->call('make:factory', [
            'name' => "{$factory}Factory",
            '--model' => $this->argument('name'),
        ]);
    }
918868
@NotNull
    public final ArtifactFactory<?> getFactory() {
        if (factory == null) {
            if (factoryClassName == null) {
                throw new IllegalStateException("Factory class name was not set: " + artifact);
            }
            if (context == null) {
                throw new IllegalStateException("Context class loader was not set: " + artifact);
            }
            final Object obj = Utils4J.createInstance(factoryClassName, context.getClassLoader());
            if (!ArtifactFactory.class.isAssignableFrom(obj.getClass())) {
                throw new IllegalStateException(
                        "Expected an object of type '" + ArtifactFactory.class.getName() + "', but was: " + obj.getClass());
            }
            factory = (ArtifactFactory<?>) obj;
            factory.init(this);
        }
        return factory;
    }
681018
static function factory()
    {
        if ( self::$factory === false )
        {
            self::$factory = true;
            self::instance()->readINISettings();
            eZImageAnalyzer::readAnalyzerSettingsFromINI();
        }
        return self::instance();
    }
710564
static public ContentHandleFactory newFactory() {
    return new ContentHandleFactory() {
      @Override
      public Class<?>[] getHandledClasses() {
        return new Class<?>[]{ InputStream.class };
      }
      @Override
      public boolean isHandled(Class<?> type) {
        return InputStream.class.isAssignableFrom(type);
      }
      @Override
      public <C> ContentHandle<C> newHandle(Class<C> type) {
        @SuppressWarnings("unchecked")
        ContentHandle<C> handle = isHandled(type) ?
                                  (ContentHandle<C>) new InputStreamHandle() : null;
        return handle;
      }
    };
  }
168733
public static TypeAdapterFactory create() {

    if (geometryTypeFactory == null) {
      geometryTypeFactory = RuntimeTypeAdapterFactory.of(Geometry.class, "type", true)
        .registerSubtype(GeometryCollection.class, "GeometryCollection")
        .registerSubtype(Point.class, "Point")
        .registerSubtype(MultiPoint.class, "MultiPoint")
        .registerSubtype(LineString.class, "LineString")
        .registerSubtype(MultiLineString.class, "MultiLineString")
        .registerSubtype(Polygon.class, "Polygon")
         .registerSubtype(MultiPolygon.class, "MultiPolygon");
    }
    return geometryTypeFactory;
  }
660566
public static function getDefault()
    {
        /** @var $factory Factory */
        $factory    = new static();
        $factory->addFactory(new CommitFactory(), 100)
                ->addFactory(new HeadFileFactory(), 80)
                ->addFactory(new DefaultFactory(), -100);
        return $factory;
    }