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 Formatter
newFormatter(String locale, String mode)
Creates a new formatter.void
setCreatedWithSPI()
Informs the implementation that it was discovered and instantiated using information collected from a file within theMETA-INF/services
directory.void
setTextBorderFactory(TextBorderFactoryMakerService service)
Sets a factory dependency.void
setTranslator(BrailleTranslatorFactoryMakerService service)
Sets a factory dependency.void
unsetTextBorderFactory(TextBorderFactoryMakerService service)
Removes a factory dependency.void
unsetTranslator(BrailleTranslatorFactoryMakerService service)
Removes a factory dependency.
-
-
-
Method Detail
-
newFormatter
public Formatter newFormatter(String locale, String mode)
Description copied from interface:FormatterFactory
Creates a new formatter.- Specified by:
newFormatter
in 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:FormatterFactory
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 interfaceFormatterFactory
-
-