Class FormatterFactoryImpl
- java.lang.Object
-
- org.daisy.dotify.formatter.impl.FormatterFactoryImpl
-
- All Implemented Interfaces:
FormatterFactory
public class FormatterFactoryImpl extends Object implements FormatterFactory
Provides a
formatter proxy implementation. This class is intended to be instantiated by the formatter factory, and is not part of the public API.Produces instances of
FormatterImpl.
-
-
Constructor Summary
Constructors Constructor Description FormatterFactoryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FormatternewFormatter(String locale, String mode)Creates a new formatter.voidsetCreatedWithSPI()Informs the implementation that it was discovered and instantiated using information collected from a file within theMETA-INF/servicesdirectory.voidsetTextBorderFactory(TextBorderFactoryMakerService service)Sets a factory dependency.voidsetTranslator(BrailleTranslatorFactoryMakerService service)Sets a factory dependency.voidunsetTextBorderFactory(TextBorderFactoryMakerService service)Removes a factory dependency.voidunsetTranslator(BrailleTranslatorFactoryMakerService service)Removes a factory dependency.
-
-
-
Method Detail
-
newFormatter
public Formatter newFormatter(String locale, String mode)
Description copied from interface:FormatterFactoryCreates a new formatter.- Specified by:
newFormatterin interfaceFormatterFactory- Parameters:
locale- the localemode- the mode- Returns:
- returns the new formatter.
-
setTranslator
public void setTranslator(BrailleTranslatorFactoryMakerService service)
Sets a factory dependency.- Parameters:
service- the dependency
-
unsetTranslator
public void unsetTranslator(BrailleTranslatorFactoryMakerService service)
Removes a factory dependency.- Parameters:
service- the dependency to remove
-
setTextBorderFactory
public void setTextBorderFactory(TextBorderFactoryMakerService service)
Sets a factory dependency.- Parameters:
service- the dependency
-
unsetTextBorderFactory
public void unsetTextBorderFactory(TextBorderFactoryMakerService service)
Removes a factory dependency.- Parameters:
service- the dependency to remove
-
setCreatedWithSPI
public void setCreatedWithSPI()
Description copied from interface:FormatterFactoryInforms the implementation that it was discovered and instantiated using information collected from a file within the
META-INF/servicesdirectory. 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:
setCreatedWithSPIin interfaceFormatterFactory
-
-