public class BrailleTranslatorFactoryMaker extends Object implements BrailleTranslatorFactoryMakerService
This class can be overridden by extending it and adding a reference to the new implementation to the services API. This class will then choose the new implementation when a new instance is requested.
Constructor and Description |
---|
BrailleTranslatorFactoryMaker()
Creates a new braille translator factory maker.
|
Modifier and Type | Method and Description |
---|---|
void |
addFactory(BrailleTranslatorFactoryService factory)
Adds a factory (intended for use by the OSGi framework)
|
Collection<TranslatorSpecification> |
listSpecifications()
Returns a list of supported specifications.
|
BrailleTranslatorFactory |
newFactory(String locale,
String grade)
Gets a factory for the given specification.
|
static BrailleTranslatorFactoryMaker |
newInstance()
Creates a new BrailleTranslatorFactoryMaker and populates it using the
SPI (java service provider interface).
|
BrailleTranslator |
newTranslator(String locale,
String grade)
Gets a translator for the given specification
|
void |
removeFactory(BrailleTranslatorFactoryService factory)
Removes a factory (intended for use by the OSGi framework)
|
boolean |
supportsSpecification(String locale,
String grade)
Returns true if the translator factory supports the given specification.
|
public BrailleTranslatorFactoryMaker()
public static BrailleTranslatorFactoryMaker newInstance()
Creates a new BrailleTranslatorFactoryMaker and populates it using the SPI (java service provider interface).
In an OSGi context, an instance should be retrieved using the service registry. It will be registered under the BrailleTranslatorFactoryMakerService interface.
public void addFactory(BrailleTranslatorFactoryService factory)
factory
- the factory to addpublic void removeFactory(BrailleTranslatorFactoryService factory)
factory
- the factory to removepublic boolean supportsSpecification(String locale, String grade)
BrailleTranslatorFactoryMakerService
supportsSpecification
in interface BrailleTranslatorFactoryMakerService
locale
- the translator localegrade
- the translator grade, or null for uncontracted braillepublic BrailleTranslatorFactory newFactory(String locale, String grade) throws TranslatorConfigurationException
newFactory
in interface BrailleTranslatorFactoryMakerService
locale
- the locale for the factorygrade
- the grade for the factoryTranslatorConfigurationException
- if the specification is not supportedpublic BrailleTranslator newTranslator(String locale, String grade) throws TranslatorConfigurationException
BrailleTranslatorFactoryMakerService
newTranslator
in interface BrailleTranslatorFactoryMakerService
locale
- the locale for the translatorgrade
- the grade for the translatorTranslatorConfigurationException
- if the specification is not supportedpublic Collection<TranslatorSpecification> listSpecifications()
BrailleTranslatorFactoryMakerService
listSpecifications
in interface BrailleTranslatorFactoryMakerService