Interface FormatterEngineFactoryService
-
- All Known Implementing Classes:
LayoutEngineFactoryImpl
public interface FormatterEngineFactoryService
Provides an interface for a FormatterEngineFactory service. The purpose of this interface is to expose an implementation of a FormaterEngine as a service.
To comply with this interface, an implementation must be thread safe and address both the possibility that only a single instance is created and used throughout and that new instances are created as desired.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description FormatterEngine
newFormatterEngine(String locale, String mode, PagedMediaWriter writer)
Returns a new FormatterEngine configured for the specified locale, mode and output writer.FormatterEngine
newFormatterEngine(FormatterConfiguration config, PagedMediaWriter writer)
Returns a new FormatterEngine configured with the specified configuration and output writer.default void
setCreatedWithSPI()
Informs the implementation that it was discovered and instantiated using information collected from a file within theMETA-INF/services
directory.
-
-
-
Method Detail
-
newFormatterEngine
FormatterEngine newFormatterEngine(String locale, String mode, PagedMediaWriter writer)
Returns a new FormatterEngine configured for the specified locale, mode and output writer.- Parameters:
locale
- the localemode
- the braille modewriter
- the output writer- Returns:
- returns a new FormatterEngine
-
newFormatterEngine
FormatterEngine newFormatterEngine(FormatterConfiguration config, PagedMediaWriter writer)
Returns a new FormatterEngine configured with the specified configuration and output writer.- Parameters:
config
- the configurationwriter
- the output writer- Returns:
- returns a new instance
-
setCreatedWithSPI
default void setCreatedWithSPI()
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.
-
-