Package org.apache.any23.extractor

## Class ExtractorRegistryImpl

- java.lang.Object
- - org.eclipse.rdf4j.common.lang.service.ServiceRegistry<String,​ExtractorFactory>
  - - org.apache.any23.extractor.ExtractorRegistryImpl

- All Implemented Interfaces:
    `ExtractorRegistry`

      public class ExtractorRegistryImpl
      extends org.eclipse.rdf4j.common.lang.service.ServiceRegistry<String,​ExtractorFactory>
      implements ExtractorRegistry

  Singleton class acting as a register for all the various `Extractor`.

- - ### Field Summary

    - ### Fields inherited from class org.eclipse.rdf4j.common.lang.service.ServiceRegistry

      `logger, services`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ExtractorRegistryImpl()` | Public constructor for ExtractorRegistryImpl.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `List<String>` | `getAllNames()` | Returns the names of all registered extractors, sorted alphabetically.
    `ExtractorGroup` | `getExtractorGroup()` |
    `ExtractorGroup` | `getExtractorGroup​(List<String> names)` | Returns an `ExtractorGroup` containing the `ExtractorFactory` mathing the names provided as input.
    `ExtractorFactory<?>` | `getFactory​(String name)` | Retrieves a `ExtractorFactory` given its name
    `static ExtractorRegistry` | `getInstance()` |
    `protected String` | `getKey​(ExtractorFactory service)` |
    `boolean` | `isRegisteredName​(String name)` |
    `void` | `register​(ExtractorFactory<?> factory)` | Registers an `ExtractorFactory`.
    `void` | `unregister​(String name)` | Unregisters the `ExtractorFactory` with the given name.

    - ### Methods inherited from class org.eclipse.rdf4j.common.lang.service.ServiceRegistry

      `add, get, getAll, getKeys, has, remove`

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

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

- - ### Constructor Detail

    - #### ExtractorRegistryImpl

          public ExtractorRegistryImpl()

      Public constructor for ExtractorRegistryImpl. Should normally call getInstance.

  - ### Method Detail

    - #### getInstance

          public static ExtractorRegistry getInstance()

      Returns:
        returns the `ExtractorRegistry` instance.

    - #### register

          public void register​(ExtractorFactory<?> factory)

      Registers an `ExtractorFactory`.
      Specified by:
        `register` in interface `ExtractorRegistry`
      Parameters:
        `factory` - the `ExtractorFactory` to register
      Throws:
        `IllegalArgumentException` - if trying to register a `ExtractorFactory` with a that already exists in the registry.

    - #### unregister

          public void unregister​(String name)

      Unregisters the `ExtractorFactory` with the given name.
      Specified by:
        `unregister` in interface `ExtractorRegistry`
      Parameters:
        `name` - The name of the ExtractorFactory to unregister.

    - #### getFactory

          public ExtractorFactory<?> getFactory​(String name)

      Retrieves a `ExtractorFactory` given its name
      Specified by:
        `getFactory` in interface `ExtractorRegistry`
      Parameters:
        `name` - of the desired factory
      Returns:
        the `ExtractorFactory` associated to the provided name
      Throws:
        `IllegalArgumentException` - if there is not a `ExtractorFactory` associated to the provided name.

    - #### getExtractorGroup

          public ExtractorGroup getExtractorGroup()

      Specified by:
        `getExtractorGroup` in interface `ExtractorRegistry`
      Returns:
        an `ExtractorGroup` with all the registered `Extractor`.

    - #### getExtractorGroup

          public ExtractorGroup getExtractorGroup​(List<String> names)

      Returns an `ExtractorGroup` containing the `ExtractorFactory` mathing the names provided as input.
      Specified by:
        `getExtractorGroup` in interface `ExtractorRegistry`
      Parameters:
        `names` - a `List` containing the names of the desired `ExtractorFactory`.
      Returns:
        the extraction group.

    - #### isRegisteredName

          public boolean isRegisteredName​(String name)

      Specified by:
        `isRegisteredName` in interface `ExtractorRegistry`
      Parameters:
        `name` - of the `ExtractorFactory`
      Returns:
        `true` if is there a `ExtractorFactory` associated to the provided name.

    - #### getAllNames

          public List<String> getAllNames()

      Returns the names of all registered extractors, sorted alphabetically.
      Specified by:
        `getAllNames` in interface `ExtractorRegistry`
      Returns:
        an alphabetically sorted `List`

    - #### getKey

          protected String getKey​(ExtractorFactory service)

      Specified by:
        `getKey` in class `org.eclipse.rdf4j.common.lang.service.ServiceRegistry<String,​ExtractorFactory>`