tigase.jaxmpp.core.client.factory

## Class UniversalFactory

- java.lang.Object
- - tigase.jaxmpp.core.client.factory.UniversalFactory

-     public class UniversalFactory
      extends Object

  Provides methods to inject alternative implementation of object in several points in this library.
  Author:
    bmalkow

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `UniversalFactory.FactorySpi<T>` Interface for object factory.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T> T` | `createInstance(String key)` Creates instance of object with given name.
    `static void` | `setSpi(String key, UniversalFactory.FactorySpi<?> spi)` Registers object factory with name.
    `static void` | `setSpi(String key, UniversalFactory.FactorySpi<?> spi, boolean overwrite)` Registers object factory with name.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### createInstance

          public static <T> T createInstance(String key)

      Creates instance of object with given name.
      Parameters:
        `key` - name of object.
      Returns:
        instance of object or `null` if no factory is registered for that name.

    - #### setSpi

          public static void setSpi(String key,
                                    UniversalFactory.FactorySpi<?> spi)

      Registers object factory with name. Previously registered factory will not be overwritten.
      Parameters:
        `key` - name of object factory.
        `spi` - implementation of factory.

    - #### setSpi

          public static void setSpi(String key,
                                    UniversalFactory.FactorySpi<?> spi,
                                    boolean overwrite)

      Registers object factory with name.
      Parameters:
        `key` - name of object factory.
        `spi` - implementation of factory.
        `overwrite` - `true` if previously registered factory should be overwritten.

Copyright © 2006–2016 Tigase. All rights reserved.