Package oracle.dbtools.plugin.api.types

## Class TypeInstantiator<T>

- java.lang.Object
- - oracle.dbtools.plugin.api.types.TypeInstantiator<T>

- Type Parameters:
    `T` - The type of object to instantiate

      public abstract class TypeInstantiator<T>
      extends java.lang.Object

  `TypeInstantiator` implementations are responsible for instantiating instances of type TypeInstantiator.
  Since:
    19.3.0
  Author:
    cdivilly

- - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `TypeInstantiator​(java.lang.Class<T> type)` | Constructor for a custom `TypeInstantiator` implementation
    `protected` | `TypeInstantiator​(java.lang.Class<T> type, boolean custom)` | Constructor

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `isCustom()` | Indicates if this is a custom instantiator for this type, or a generic one provided by the dependency injection framework
    `abstract T` | `load​(InstanceLocator locator)` | Instantiate the instance of T
    `protected TypeDependencyNotAvailableException` | `notAvailable​(java.lang.Throwable cause)` |
    `java.lang.Class<T>` | `type()` | The type that will be instantiated

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

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

- - ### Constructor Detail

    - #### TypeInstantiator

          protected TypeInstantiator​(java.lang.Class<T> type)

      Constructor for a custom `TypeInstantiator` implementation
      Parameters:
        `type` - The type that will be instantiated

    - #### TypeInstantiator

          protected TypeInstantiator​(java.lang.Class<T> type,
                                     boolean custom)

      Constructor
      Parameters:
        `type` - The type that will be instantiated
        `custom` - if true indicates this is a custom `TypeInstantiator` implementation, as opposed to one generated by the dependency injection runtime

  - ### Method Detail

    - #### isCustom

          public boolean isCustom()

      Indicates if this is a custom instantiator for this type, or a generic one provided by the dependency injection framework
      Returns:
        true if this is a custom instantiator, false if this is a generic instantiator

    - #### load

          public abstract T load​(InstanceLocator locator)
                          throws TypeDependencyNotAvailableException

      Instantiate the instance of T
      Parameters:
        `locator` - The `InstanceLocator` that provides the dependencies required to instantiate T
      Returns:
        instance of T
      Throws:
        `TypeDependencyNotAvailableException` - if the type could not be instantiated

    - #### type

          public final java.lang.Class<T> type()

      The type that will be instantiated
      Returns:
        The type that this `TypeInstantiator` instantiates

    - #### notAvailable

          protected final TypeDependencyNotAvailableException notAvailable​(java.lang.Throwable cause)