Package org.apache.any23.extractor
Class ExtractorRegistryImpl
- java.lang.Object
-
- org.eclipse.rdf4j.common.lang.service.ServiceRegistry<String,org.apache.any23.extractor.ExtractorFactory>
-
- org.apache.any23.extractor.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 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.org.apache.any23.extractor.ExtractorGroup
getExtractorGroup()
org.apache.any23.extractor.ExtractorGroup
getExtractorGroup(List<String> names)
Returns anExtractorGroup
containing theExtractorFactory
mathing the names provided as input.org.apache.any23.extractor.ExtractorFactory<?>
getFactory(String name)
Retrieves aExtractorFactory
given its namestatic org.apache.any23.extractor.ExtractorRegistry
getInstance()
protected String
getKey(org.apache.any23.extractor.ExtractorFactory service)
boolean
isRegisteredName(String name)
void
register(org.apache.any23.extractor.ExtractorFactory<?> factory)
Registers anExtractorFactory
.void
unregister(String name)
Unregisters theExtractorFactory
with the given name.
-
-
-
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 anExtractorFactory
.- Specified by:
register
in interfaceorg.apache.any23.extractor.ExtractorRegistry
- Parameters:
factory
- theExtractorFactory
to register- Throws:
IllegalArgumentException
- if trying to register aExtractorFactory
with a that already exists in the registry.
-
unregister
public void unregister(String name)
Unregisters theExtractorFactory
with the given name.- Specified by:
unregister
in interfaceorg.apache.any23.extractor.ExtractorRegistry
- Parameters:
name
- The name of the ExtractorFactory to unregister.
-
getFactory
public org.apache.any23.extractor.ExtractorFactory<?> getFactory(String name)
Retrieves aExtractorFactory
given its name- Specified by:
getFactory
in interfaceorg.apache.any23.extractor.ExtractorRegistry
- Parameters:
name
- of the desired factory- Returns:
- the
ExtractorFactory
associated to the provided name - Throws:
IllegalArgumentException
- if there is not aExtractorFactory
associated to the provided name.
-
getExtractorGroup
public org.apache.any23.extractor.ExtractorGroup getExtractorGroup()
- Specified by:
getExtractorGroup
in interfaceorg.apache.any23.extractor.ExtractorRegistry
- Returns:
- an
ExtractorGroup
with all the registeredExtractor
.
-
getExtractorGroup
public org.apache.any23.extractor.ExtractorGroup getExtractorGroup(List<String> names)
Returns anExtractorGroup
containing theExtractorFactory
mathing the names provided as input.- Specified by:
getExtractorGroup
in interfaceorg.apache.any23.extractor.ExtractorRegistry
- Parameters:
names
- aList
containing the names of the desiredExtractorFactory
.- Returns:
- the extraction group.
-
isRegisteredName
public boolean isRegisteredName(String name)
- Specified by:
isRegisteredName
in interfaceorg.apache.any23.extractor.ExtractorRegistry
- Parameters:
name
- of theExtractorFactory
- Returns:
true
if is there aExtractorFactory
associated to the provided name.
-
getAllNames
public List<String> getAllNames()
Returns the names of all registered extractors, sorted alphabetically.- Specified by:
getAllNames
in interfaceorg.apache.any23.extractor.ExtractorRegistry
-
-