Class ExtractorRegistryImpl

  • All Implemented Interfaces:
    org.apache.any23.extractor.ExtractorRegistry

    public class ExtractorRegistryImpl
    extends org.eclipse.rdf4j.common.lang.service.ServiceRegistry<String,​org.apache.any23.extractor.ExtractorFactory>
    implements org.apache.any23.extractor.ExtractorRegistry
    Singleton class acting as a register for all the various Extractor.
    • Constructor Detail

      • ExtractorRegistryImpl

        public ExtractorRegistryImpl()
        Public constructor for ExtractorRegistryImpl. Should normally call getInstance.
    • Method Detail

      • getInstance

        public static org.apache.any23.extractor.ExtractorRegistry getInstance()
        Returns:
        returns the ExtractorRegistry instance.
      • register

        public void register​(org.apache.any23.extractor.ExtractorFactory<?> factory)
        Registers an ExtractorFactory.
        Specified by:
        register in interface org.apache.any23.extractor.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 org.apache.any23.extractor.ExtractorRegistry
        Parameters:
        name - The name of the ExtractorFactory to unregister.
      • getFactory

        public org.apache.any23.extractor.ExtractorFactory<?> getFactory​(String name)
        Retrieves a ExtractorFactory given its name
        Specified by:
        getFactory in interface org.apache.any23.extractor.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 org.apache.any23.extractor.ExtractorGroup getExtractorGroup()
        Specified by:
        getExtractorGroup in interface org.apache.any23.extractor.ExtractorRegistry
        Returns:
        an ExtractorGroup with all the registered Extractor.
      • getExtractorGroup

        public org.apache.any23.extractor.ExtractorGroup getExtractorGroup​(List<String> names)
        Returns an ExtractorGroup containing the ExtractorFactory mathing the names provided as input.
        Specified by:
        getExtractorGroup in interface org.apache.any23.extractor.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 org.apache.any23.extractor.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 org.apache.any23.extractor.ExtractorRegistry
      • getKey

        protected String getKey​(org.apache.any23.extractor.ExtractorFactory service)
        Specified by:
        getKey in class org.eclipse.rdf4j.common.lang.service.ServiceRegistry<String,​org.apache.any23.extractor.ExtractorFactory>