Package org.daisy.dotify.translator.impl
Class DefaultBypassTranslatorFactoryService
- java.lang.Object
-
- org.daisy.dotify.translator.impl.DefaultBypassTranslatorFactoryService
-
- All Implemented Interfaces:
BrailleTranslatorFactoryService
public class DefaultBypassTranslatorFactoryService extends Object implements BrailleTranslatorFactoryService
Provides a pass through translator factory service.
-
-
Constructor Summary
Constructors Constructor Description DefaultBypassTranslatorFactoryService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<TranslatorSpecification>
listSpecifications()
Returns a list of supported specifications.BrailleTranslatorFactory
newFactory()
Creates a new braille translator factory.void
setCreatedWithSPI()
Informs the implementation that it was discovered and instantiated using information collected from a file within theMETA-INF/services
directory.void
setHyphenator(HyphenatorFactoryMakerService hyphenator)
Sets the hyphenator factory maker service.boolean
supportsSpecification(String locale, String mode)
Returns true if the translator factory supports the given specification.void
unsetHyphenator(HyphenatorFactoryMakerService hyphenator)
Unsets the hyphenator factory maker service.
-
-
-
Method Detail
-
supportsSpecification
public boolean supportsSpecification(String locale, String mode)
Description copied from interface:BrailleTranslatorFactoryService
Returns true if the translator factory supports the given specification.- Specified by:
supportsSpecification
in interfaceBrailleTranslatorFactoryService
- Parameters:
locale
- the translator localemode
- the translator grade, or null for uncontracted braille- Returns:
- returns true if the translator factory supports the specification
-
newFactory
public BrailleTranslatorFactory newFactory()
Description copied from interface:BrailleTranslatorFactoryService
Creates a new braille translator factory.- Specified by:
newFactory
in interfaceBrailleTranslatorFactoryService
- Returns:
- returns a new braille translator factory
-
setHyphenator
public void setHyphenator(HyphenatorFactoryMakerService hyphenator)
Sets the hyphenator factory maker service.- Parameters:
hyphenator
- the hyphenator factory maker service.
-
unsetHyphenator
public void unsetHyphenator(HyphenatorFactoryMakerService hyphenator)
Unsets the hyphenator factory maker service.- Parameters:
hyphenator
- the instance to unset.
-
listSpecifications
public Collection<TranslatorSpecification> listSpecifications()
Description copied from interface:BrailleTranslatorFactoryService
Returns a list of supported specifications.- Specified by:
listSpecifications
in interfaceBrailleTranslatorFactoryService
- Returns:
- returns a list of specifications
-
setCreatedWithSPI
public void setCreatedWithSPI()
Description copied from interface:BrailleTranslatorFactoryService
Informs the implementation that it was discovered and instantiated using information collected from a file within the
META-INF/services
directory. In other words, it was created using SPI (service provider interfaces).This information, in turn, enables the implementation to use the same mechanism to set dependencies as needed.
If this information is not given, an implementation should avoid using SPIs and instead use declarative services for dependency injection as specified by OSGi. Note that this also applies to several newInstance() methods in the Java API.
The class that created an instance with SPI must call this method before putting it to use.
- Specified by:
setCreatedWithSPI
in interfaceBrailleTranslatorFactoryService
-
-