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.ExtractorGroupgetExtractorGroup()org.apache.any23.extractor.ExtractorGroupgetExtractorGroup(List<String> names)Returns anExtractorGroupcontaining theExtractorFactorymathing the names provided as input.org.apache.any23.extractor.ExtractorFactory<?>getFactory(String name)Retrieves aExtractorFactorygiven its namestatic org.apache.any23.extractor.ExtractorRegistrygetInstance()protected StringgetKey(org.apache.any23.extractor.ExtractorFactory service)booleanisRegisteredName(String name)voidregister(org.apache.any23.extractor.ExtractorFactory<?> factory)Registers anExtractorFactory.voidunregister(String name)Unregisters theExtractorFactorywith the given name.
-
-
-
Method Detail
-
getInstance
public static org.apache.any23.extractor.ExtractorRegistry getInstance()
- Returns:
- returns the
ExtractorRegistryinstance.
-
register
public void register(org.apache.any23.extractor.ExtractorFactory<?> factory)
Registers anExtractorFactory.- Specified by:
registerin interfaceorg.apache.any23.extractor.ExtractorRegistry- 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 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 aExtractorFactorygiven its name- Specified by:
getFactoryin interfaceorg.apache.any23.extractor.ExtractorRegistry- 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 org.apache.any23.extractor.ExtractorGroup getExtractorGroup()
- Specified by:
getExtractorGroupin interfaceorg.apache.any23.extractor.ExtractorRegistry- Returns:
- an
ExtractorGroupwith all the registeredExtractor.
-
getExtractorGroup
public org.apache.any23.extractor.ExtractorGroup getExtractorGroup(List<String> names)
Returns anExtractorGroupcontaining theExtractorFactorymathing the names provided as input.- Specified by:
getExtractorGroupin interfaceorg.apache.any23.extractor.ExtractorRegistry- Parameters:
names- aListcontaining the names of the desiredExtractorFactory.- Returns:
- the extraction group.
-
isRegisteredName
public boolean isRegisteredName(String name)
- Specified by:
isRegisteredNamein interfaceorg.apache.any23.extractor.ExtractorRegistry- 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 interfaceorg.apache.any23.extractor.ExtractorRegistry
-
-