org.qi4j.api.service.importer

## Class NewObjectImporter<T>

- java.lang.Object
- - org.qi4j.api.service.importer.NewObjectImporter<T>

- All Implemented Interfaces:
    ServiceImporter<T>

      public final class NewObjectImporter<T>
      extends Object
      implements ServiceImporter<T>

  Import Services using a new registered Object instance.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NewObjectImporter()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `importService(ImportedServiceDescriptor serviceDescriptor)` Imports an instance of the service type described in the service descriptor.
    `boolean` | `isAvailable(T instance)` Ask if the service is available or not.

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

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

- - ### Constructor Detail

    - #### NewObjectImporter

          public NewObjectImporter()

  - ### Method Detail

    - #### importService

          public T importService(ImportedServiceDescriptor serviceDescriptor)
                          throws ServiceImporterException

      Description copied from interface: `ServiceImporter`
      Imports an instance of the service type described in the service descriptor.
      Specified by:
        `importService` in interface `ServiceImporter<T>`
      Parameters:
        `serviceDescriptor` - The service descriptor.
      Returns:
        The imported service instance.
      Throws:
        `ServiceImporterException` - if import failed.

    - #### isAvailable

          public boolean isAvailable(T instance)

      Description copied from interface: `ServiceImporter`
      Ask if the service is available or not.
      Specified by:
        `isAvailable` in interface `ServiceImporter<T>`
      Parameters:
        `instance` - the instance to be checked
      Returns:
        true if the service is available, false if not