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 variousExtractor.
-
-
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.ExtractorGroupgetExtractorGroup()ExtractorGroupgetExtractorGroup(List<String> names)Returns anExtractorGroupcontaining theExtractorFactorymathing the names provided as input.ExtractorFactory<?>getFactory(String name)Retrieves aExtractorFactorygiven its namestatic ExtractorRegistrygetInstance()protected StringgetKey(ExtractorFactory service)booleanisRegisteredName(String name)voidregister(ExtractorFactory<?> factory)Registers anExtractorFactory.voidunregister(String name)Unregisters theExtractorFactorywith the given name.
-
-
-
Method Detail
-
getInstance
public static ExtractorRegistry getInstance()
- Returns:
- returns the
ExtractorRegistryinstance.
-
register
public void register(ExtractorFactory<?> factory)
Registers anExtractorFactory.- Specified by:
registerin interfaceExtractorRegistry- Parameters:
factory- theExtractorFactoryto register- Throws:
IllegalArgumentException- if trying to register aExtractorFactorywith a that already exists in the registry.
-
unregister
public void unregister(String name)
Unregisters theExtractorFactorywith the given name.- Specified by:
unregisterin interfaceExtractorRegistry- Parameters:
name- The name of the ExtractorFactory to unregister.
-
getFactory
public ExtractorFactory<?> getFactory(String name)
Retrieves aExtractorFactorygiven its name- Specified by:
getFactoryin interfaceExtractorRegistry- Parameters:
name- of the desired factory- Returns:
- the
ExtractorFactoryassociated to the provided name - Throws:
IllegalArgumentException- if there is not aExtractorFactoryassociated to the provided name.
-
getExtractorGroup
public ExtractorGroup getExtractorGroup()
- Specified by:
getExtractorGroupin interfaceExtractorRegistry- Returns:
- an
ExtractorGroupwith all the registeredExtractor.
-
getExtractorGroup
public ExtractorGroup getExtractorGroup(List<String> names)
Returns anExtractorGroupcontaining theExtractorFactorymathing the names provided as input.- Specified by:
getExtractorGroupin interfaceExtractorRegistry- Parameters:
names- aListcontaining the names of the desiredExtractorFactory.- Returns:
- the extraction group.
-
isRegisteredName
public boolean isRegisteredName(String name)
- Specified by:
isRegisteredNamein interfaceExtractorRegistry- Parameters:
name- of theExtractorFactory- Returns:
trueif is there aExtractorFactoryassociated to the provided name.
-
getAllNames
public List<String> getAllNames()
Returns the names of all registered extractors, sorted alphabetically.- Specified by:
getAllNamesin interfaceExtractorRegistry- Returns:
- an alphabetically sorted
List
-
getKey
protected String getKey(ExtractorFactory service)
- Specified by:
getKeyin classorg.eclipse.rdf4j.common.lang.service.ServiceRegistry<String,ExtractorFactory>
-
-